OK...not sure where this goes but some help would be awsome....

etterjt

New member
Local time
Today, 06:33
Joined
Nov 25, 2002
Messages
6
I want to make a search command button so that when i click on it, i get prompted to enter a date. I have a database set up and I enter dates of appointment letters when I enter user information. I want to be able to say everybody who has an appointment letter older then "this" date to pop up in a report.....i just need help with the prompt and search...i've sifted through the forums and got bits and pieces but nothing solid...please help if you can.

Jack
 
Sorry that I'm a bit rushed right now or I would write a fragment that might help you. But here is the gist of it.

1. Write a parameter query for which the date is the parameter. Read the HELP files on parameter queries. Be sure to read the examples of using parameter queries with VBA code.

2. Create your search button using the Command Button wizard and tell it to open the query. The query you will open is the one you write in step 1 above. That's why you created the query first.

3. Now go back into the button_click event code that the wizard built for you. There will be a part where the wizard built in a DoCmd OpenQuery for you. In front of that code, you need to insert an Input Box to demand and accept the date. Read the HELP files on Input Box. What you'll get back is a string that contains whatever was input. To treat this as a date, enclose the date string in # (on either side, as #1-Jan-2003#) and store this as the parameter for your parameter query.

4. Now recompile and save the code.

That should do the trick for you.
 

Users who are viewing this thread

Back
Top Bottom