user input

fanfan2

Registered User.
Local time
Today, 03:31
Joined
Feb 26, 2007
Messages
61
On the form, I would like to have the user to input a date, then it opens a query base on the date entered. What is the best way to do it? Thanks in advance.
 
You could have a button that opens a pop up form that uses your query as a data source. Your query would use the following as Criteria for date;
Code:
Forms!FRM_Name!DateFieldName
Where FRM_Name! is the name of the referring Form
 
Thanks.
But where does the user input the date?
 
I had assumed that you had a form on which the button and the date, you wanted to query, resided. If this not the case simply put the following in the Criteria under date in your query;
Code:
[Please enter a search date]
or what ever text you wish to appear as a prompt.
 
Sorry I'm new on this and didn't quite get it.

If on the query I put the code [enter the date] under creteria, should I make a text box on the form with the same name "enter the date"? Or how can the query find the date user entered? thanks.
 
OK step by Step;
  1. Create your query so that it is selecting the data you want.
  2. In the criteria section in the Date column, put the code I gave you previously.
  3. Save the query.
  4. Now run the query (click the apostrophe "!")
  5. The next thing that will happen is a small dialogue box with appear with the text you put in the square brackets.
  6. Click OK and bingo job done.
As an aside do not use names like Date, Time etc. as field name as these are reserved by Access as function names and will complicate the future writing of code.
 

Users who are viewing this thread

Back
Top Bottom