I have a simple parameter dialog box for the user to enter a date to search.
The problem is this field is a date/time field and returns NOTHING if they
don't enter in the correct date format --/--/----. I want a sample data or
input mask in the dialog box text field. Possible?
Like [Enter Date: ] & "*"
No it's not possible.
If you are actually opening the query (not using the query as record
source for a report), then ....
Create a form for the entry of the parameter.
Add an unbound text control.
Set the control's Format to Short Date.
Name this control 'FromDate'.
The above control format will force a valid date entry, however we'll
add some code to the form to verify that it is a date.
Add a command button to the form
Code the button's Click event:
If IsDate(Me![FromDate]) Then
DoCmd.OpenQuery "QueryName"
DoCmd.Close acForm, Me.Name
Else
MsgBox "Enter a valid date."
End If
Name this form 'ParamForm'
Change your query parameter from:
Like [Enter Date: ] & "*"
To..
=forms!ParamForm!FromDate
When you wish to run the query open the form. Enter the date and click
the command button. The query will display and the form will close.