My current code is as follows
I think I have correctly connected to the database how could I store each of the columns into a label?Code:Dim cn As ADODB.Connection, rs As ADODB.Recordset, r As Long Datalist.Clear Set cn = New ADODB.Connection cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\Users\User\Desktop\test\dbAdd.mdb;" Set rs = New ADODB.Recordset rs.Open "SELECT CertNo,IssueDate,Serial,RecalDue,CertNo_Vic,IssueDate_Vic,Serial_Vic,RecalDue_Vic FROM STICKER WHERE CertNo = '" & Data1 & "';", cn, adOpenStatic, adLockOptimistic Set rs = Nothing Set cn = Nothing
also is it possible to have instead of Data1 to have a selected listbox1 item to decide what row is pulled from the DB?


Reply With Quote
