Parameters from a Form

Bill Moore

Registered User.
Local time
Today, 00:33
Joined
Dec 11, 2003
Messages
51
I have a Query using 16 parameters. It runs fine if I run it directly, supplying all the parameters when prompted. To make it easier on the user, I developed a form on which to enter the parameters with a command button to run the query.

When I run it this way, gives no results. I know that names have to match betwen the form and the query. I've checked that and they do. Still no results.

Any ideas??

Thx.
 
Bill,

Are you entering your criteria like:

Forms![YourFormName]![YourField]

And your form must be open when the query is being run.

If you just get no rows returned, then nothing matches.
If Access brings up the "Enter Parameter" dialog box, then it
can't resolve the names you are using in your criteria.

Wayne
 
Wayne,

The form is open and completely filled out with the required parameters before the command button to execute the query is clicked.

I don't get any standard parameter boxes when they're entered on the form. The query just doesn't return any rows.

As far as syntax is concerned, I do use the format

!Forms!FormName!FieldName

The only thing I'm unsure about is the proper use of [] if required. My documentation doesn't seem to address their use or lack thereof. If you know the answer to this issue give me another example and I'll try that.

Thx.
 
Bill,

Since you are not getting "Enter Parameter", then Access is
correctly referencing the forms controls in your criteria.

It must be that no rows correctly match the criteria.

Are you searching by using "fragments" of strings? Maybe you
just need:

Like "*" & Forms![YourForm]![SomeField] & "*"

Wayne
 
Bill:

Have you considered passing a QueryDef to the query using code? Attached is an example of how to accomplish this...

HTH
 

Attachments

problem solved

I solved my problem with the query parameters. Turns out, one of the combo boxes on the parameter form was accesssing a table with 2 columns. The "bound column" property was set to 1 when I really needed column 2. Changed that and everything worked.

Thanks for the help and suggestions from everyone.

Bill.
 

Users who are viewing this thread

Back
Top Bottom