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

Recommended Answers

All 2 Replies

Ok, can you start by speaking English, then post some code so I can review this?

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.