Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query parameter from a form 2

Status
Not open for further replies.

Aietoe

Technical User
Nov 30, 2000
85
CA
I execute a query getting my parameter from a form.

I'm looking for a way to execute my query without any criteria when the parameter box is left blank in the form.

Thanks in advance for your help.
 
Perhaps something like this...

Sub YourRoutineThatNormallyExecutesQuery()

[red]If [/red]Me![SubjectFormField] = "" then 'its empty !
' execute query that uses no parameters

[red]Else [/red]
' Execute query that uses form parameter.

[red]End If[/red]

End Sub Amiel
amielzz@netscape.net

 
Hi Terry

I tried your solution and it worked out very well.

I had to work a little bit on each of my parameter's properties, but it finally did what i was expecting.One query does everything when i tought i had to create many many queries for every combination of parameters.

And even if my tables content over 7 millions records, the execution is not that slow.

Thanks again

Gilles
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top