Searching

  • Thread starter Thread starter Fie
  • Start date Start date
F

Fie

Hi,

I have an Acess 97 database that has a table tblWhiteGoods which has
fields (ID, Date, Microwaves, Fridges, Oven, Tumble Dryer) which tracks
number of good i.e Microwaves, Fridges & Ovens etc that have been
uplifted.
I have created a search form that askes user to enter a date by which
the good has been collected. When the user enters the date I wish for
the details relating to this date to be displayed in a listbox.
What code should I put behind the search button? Currently I have

Private Sub Command8_Click()
SrchLst.RowSource = "SELECT tblWhiteGoods.[ID], tblWhiteGoods.Date FROM
tblWhiteGoods WHERE (((tblWhiteGoods.Date) Like ""*" & Text6 & "*""));"
End Sub
 
Try this:
Me.SrchLst.RowSource = "SELECT tblWhiteGoods.[ID], tblWhiteGoods.Date
FROM
tblWhiteGoods WHERE (((tblWhiteGoods.Date)=#" & Format(CDate(Me.Text6),
"yyyy/mm/dd") & "#));"

Me.SrchLst.Requery
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top