Dim cn As New ADODB.Connection Dim rs As New ADODB.Recordset Dim cmd As New ADODB.Command Private Sub Command1_Click() Dim q As Integer Dim intCtrl As Integer Dim x As Integer Dim z As Integer x = 0 q = 0 z = 0 With DR .Hide Set .DataSource = rs .DataMember = "" With .Sections("Section1").Controls For intCtrl = 1 To .Count If TypeOf .Item(intCtrl) Is RptLabel Then .Item(intCtrl).Caption = rs.Fields(q).Name & " :" q = q + 1 End If If TypeOf .Item(intCtrl) Is RptTextBox Then .Item(intCtrl).DataMember = "" .Item(intCtrl).DataField = rs(z).Name z = z + 1 End If Next intCtrl End With .Refresh .Show End With End Sub Private Sub Form_Load() Command1.Caption = "Show Report" cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\Program Files\Microsoft Visual Studio\VB98\Nwind.mdb;" With cmd .ActiveConnection = cn .CommandType = adCmdText .CommandText = "Select FirstName, Lastname from Employees" .Execute End With With rs .ActiveConnection = cn .CursorLocation = adUseClient .Open cmd End With End Sub