You can build the SQL string, something like:
strSQL = "SELECT * FROM mytable WHERE [thedatetoselect] = #" &
Me!txtDateToFind & """"
or put the following in the Criteria line under Field "thedatetoselect" in
the Query builder:
[txtDateToFind]
but you may have to fully qualify the Control name, as in
Forms![yourformname]![txtDateToFind].
You can use the BETWEEN operator in SQL to select dates that fall between a
start and stop date, too...
Larry Linson
Microsoft Access MVP
JOM said:
It was just an example, this what I would like to do, I have unbound
combox
in my form, it has all the dates in my table, so i would like to search
for
all the records on my form that have the date that I selected from the
combobox
Larry Linson said:
How do i enclose the date in my code e.g, if searching for something
that
is
of a number "[FieldID] =" & Str(Nz(Me![Controlsource], 0)) What about
the
date?
Except in the text of your message, I see nothing related to date. Could
you
clarify whether this was just an example of something else, or did you
intend that the date be somehow related?
Larry Linson
Microsoft Access MVP