hey im making a database on licnese issuing authority now i want get data retrived frm da database ma access to list boxes but i want data only of the data which i slelect fmr da dtpicker can u plz suggest a code for this thx

i have following list boxes and this data is fetched from access on formload, this is the code just for fetching the data.
f3 represents a date

Private Sub Form_Load()
With Adodc1
    .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\project.MDB"
    .RecordSource = "Select * from tbl_Applicant_Update"
    .CommandType = adCmdText
    .Refresh
End With
List1.AddItem Adodc1.Recordset.Fields!lF1
List2.AddItem Adodc1.Recordset.Fields!F2
List3.AddItem Adodc1.Recordset.Fields!F3
End Sub

I also have a dtpicker on the form
I want that tha date seletced from dtpicker becomes f3 and list box 3 hides on form load
and data is retrived in the test boxes in accordance with the value in dtpicker

heres the code i made for it,kindly ammend it or suggest one

Private Sub Form_Load()
With Adodc1
    .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\project.MDB"
    .RecordSource = "Select f1,f2, f3* from tbl_Applicant_Update where f3*=dtpicker1.value"
    .CommandType = adCmdText
    '.Refresh
End With
List1.AddItem Adodc1.Recordset.Fields!licnumber
List2.AddItem Adodc1.Recordset.Fields!cnic

End Sub

thanks

This article has been dead for over six months. Start a new discussion instead.