Is this what you are asking?
Code:'' error handling, not included =) Dim index As Long Dim m_conn As ADODB.Connection Dim rs As ADODB.Recordset If (loadedcheck) Then Exit Sub Set m_conn = New ADODB.Connection Set rs = New ADODB.Recordset m_conn.Open("DRIVER={Microsoft Access Driver (*.mdb)};" & _ "DBQ=" & strDBName & ";" & _ "UID=" & strUser & ";" & _ "PWD=" & strPassword & ";") Call rs.Open("SELECT * FROM myDB", m_conn) Call rs.MoveFirst index = 0 Do If (index > 0) Then Load CheckGDW(index) CheckGDW(index).Top = CheckGDW(index).Height * index + CheckGDW(index).Top End If CheckGDW(index).Visible = True CheckGDW(index).Caption = rs!CustomerID index = index + 1 Call rs.MoveNext Loop Until rs.EOF() loadedcheck = True




Reply With Quote