Change Query Data with a Form Access 2010???

adam.grendell

Registered User.
Local time
Yesterday, 21:23
Joined
Dec 7, 2011
Messages
21
Is there a way to add/remove query fields on a form before running said query?

Thanks
 
Welcome to the forum.

If you have a number of fields on a search form, some of which the user may leave blank, you could use the following in the criteria of your query for each field;
Code:
Like IIf(IsNull([Forms]![YourFormNameHere]![YOurFieldNameHere]),"*",[Forms]![YourFormNameHere]![YOurFieldNameHere])
 
Thanks for the welcome, sir.

Here is the issue. I have a payroll database, that has a table for Employees, Payroll, and Users (for logging in). If I want to create a report, I can make a query for each of the fields that I wish to sort by in the report (without including each and every field in said report), and then make the report of that query.

However, if I want to create just one query, and change the criteria of the query with a combo box on a form, perhaps, how would I do so. I haven't posted enough so I don't think that I can upload my DB yet.

If I'm being to vague or unclear, I apologize. :confused:
 
You should be able to post your DB if you follow the instructions here.

In the mean time, perhaps the article here will give you some clues.
 
I think I've found a way to specify what it is that I want to do. By the way, thanks for the link, but to be honest it was a bit over my head.

The search form I have has a combo box for the name, and two textboxes for start and end date. The second combo box, I want to select that field from the payroll table and remove all the rest from the query (or create a query with only that field as the source, and then output to a report. Here is the db file.

Thanks for the continued assistance.

View attachment Payroll v2.01.zip
 

Users who are viewing this thread

Back
Top Bottom