Use date entered via message box to drive a query?

chuckles1066

New member
Local time
Today, 09:02
Joined
Aug 6, 2009
Messages
2
Hi,

Hope someone can help with some code.

I need to produce a mailing list based on a customers and orders query.

What I would like to happen is when I click on a button (imaginatively named "produce mailing list"!) a message box pops up saying something like "enter publication date" and the user enters, say, 09/09/2009.

When they click ok, a query fires up which will find any orders where (in this case) order start date <=09/09/2009 and order end date >=09/09/2009.

All advice greatly appreciated.

(Using 2007 btw).
 
Where's your button?

This just a simple query by form

You have a form called produce_mailing_list no spaces in names they only cause problems whicj has a text box or 2 formatted for short date call them StartDate and EndDate and a command button to run your query which in the criteria says something like
= Forms!produce_mailing_list!Startdate
or
Between Forms!produce_mailing_list!StartDate and Forms!produce_mailing_list!EndDate

Play with it to see what you want

Brian
 
or in the criteria row, just put any text inside square brackets - eg

[ask for date]

now, access will open an input box, to ask for the date you want.

---------
this tends to be the way we all start - and then instead of doing it this way, we get the date off a form, as already explained, because then you dont have to keep responding to input box messages

--------
the square bracket syntax is good if you are just testing something, though
 

Users who are viewing this thread

Back
Top Bottom