Creating a form that displays results for a certain date?

What is the process for creating a form that will return all records for a certain date?  Or rather, how can I incorporate a variable into my SQL syntax?

Preferably when a user opens this form, they would select a date and a subform would render the records that match that date.  Something along the lines of SELECT * FROM visits WHERE visits.date=variableDateFromForm

Thanks in advance!
LVL 1
WavyGravyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rgn2121Commented:
You could have the Subform bound to SELECT * FROM visits and then on the After_Update event of your date selection, you could filter and requery the subform.

Me.subFormName.Form.Filter = "visits.date = #" & variableDateFromForm & "#"
me.subform.Form.FilterOn=True
Me.subForm.Form.Requery
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.