Forms date input to query field not working.

J

Jeff

Hello, I am writing a database and have a report that
opens a form asking for input. When the form closes the
query runs but seems to select all records. I made a
field that shows what date was transfered from the form
and it shows up as '01/01/2003'. The dates in the
database table show up as '1/1/2003', will this make a
difference? If I remove the form field as an input to the
report and hardcode a date such as #01/01/2003# the query
runs fine and selects the expected number of records.
What do I need to do to make the form supply the correct
info for the query to work?

Thanks in advance!
Jeff
 
F

fredg

Hello, I am writing a database and have a report that
opens a form asking for input. When the form closes the
query runs but seems to select all records. I made a
field that shows what date was transfered from the form
and it shows up as '01/01/2003'. The dates in the
database table show up as '1/1/2003', will this make a
difference? If I remove the form field as an input to the
report and hardcode a date such as #01/01/2003# the query
runs fine and selects the expected number of records.
What do I need to do to make the form supply the correct
info for the query to work?

Thanks in advance!
Jeff.

The form must remain open when the report is run. You wrote that the
form closes, then the query runs.

The usual method is for the report to open the form in Dialog for
parameter entry. The command button on the form is coded to make the
form not visible. The report runs and shows the data. The report Close
event closes the form.

The query DateField criteria is set to something like
forms!NameOfForm!NameOfControl
 
J

Jeff

Thanks for the response but I found the answer that I
needed. The search field needed to have a entry such as:
DateValue([Forms]![SearchForm]![StartDate])
in order for the report to work right.

Thanks,
Jeff
 

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

Top