HELP!!!

junmart

Registered User.
Local time
Today, 04:00
Joined
Sep 14, 2001
Messages
29
how do i stop a parameter query to stop showing all records every time users leave the parameter blank? i am using a query to limit the records my users can view but all records are shown when they didnt enter any parameter! it defeats the whole purpose of my query being used as a security tool! please help!
 
I copied this code from one of the access wizards

It requires that a beginning date and an ending date is entered. If no dates are entered the user gets a message box telling them to enter dates. This uses the IsNull method.

In addition (i think!) it also requires that you use a Query By Form method so that you can place the code on the form.

for information on this check out this link to MS knowledge base
http://support.microsoft.com/support/kb/articles/Q209/6/45.ASP?LN=EN-US&SD=gn&FR=0&qry=QBF&rnk=2&src=DHCS_MSPSS_gn_SRCH&SPR=ACC2000

Hope this helps

Private Sub Preview_Click()
If IsNull([Beginning Call Date]) Or IsNull([Ending Call Date]) Then
MsgBox "You must enter both beginning and ending dates."
DoCmd.GoToControl "Beginning Call Date"
Else
If [Beginning Call Date] > [Ending Call Date] Then
MsgBox "Ending date must be greater than Beginning date."
DoCmd.GoToControl "Beginning Call Date"
Else
Me.Visible = False
End If
End If
End Sub


[This message has been edited by mickman17 (edited 09-20-2001).]
 

Users who are viewing this thread

Back
Top Bottom