Question Running the same query with multiple criteria at once

sureshmopl

Registered User.
Local time
Today, 19:35
Joined
Oct 24, 2016
Messages
11
Hi I have a table of around 1000 records with different data of 250 employees with employee code. I needs to run a query which creates a PDF or HTML file for each employee separately with their respective details.I know the select query will solve the purpose for each employee code criteria but that will requires 250 queries to run one by one. What I need is a simple solution which will run 250 queries at once and create the output files with a command button click. Please help me.
 
Can you describe your data layout - with some example data. It sounds like you need a query to pull the correct data.
 
Hi Thank you very much for the response. Yes my purpose is to pull the data corresponding to the employee code and make an output file (pdf or html). It can be through query or module. Whichever makes it easy. My Table Design is as follows :
Field name Data Type
Employee code Number
Employee Name Text
Designation Text
Document number Number
Investment date Date etc. The tables contains multiple records of same employee. Please suggest a suitable solution. Thanks again
 
So would it be correct in assuming that Employee Code, Name and possibly Designation are the same for each employee's record, and that the other fields have the data you want to extract per employee?
 
Yes it is. Just wants to filer the data based on the employee code. Rest will be same.
 
Hi Thank you for the link. I have gone through it in detail. But its too advanced for me and it is basically answering the mass e-mailing aspect. What I needed is a simple solution for running multiple queries that give respective pdf or html files output at once. I know how to do it one by one running a single query by inputting the employee code value for each employee. But needs a solution for automating the process. Any other method?
 
Short answer - No.
To create multiple documents you will have to create a recordset and loop around it. So the techniques demonstrated are really the only way to do it sensibly.

Start with small steps. First get your data into a query - this can be a saved query so you can use the designer.

Next create a simple code to open that query as a recordset. Then create a simple loop to go through the recordset and simply pop a message box up with the each User name , or do a debug.print of the field, to ensure you are getting the structure correct.

Once you have done that you are in a position to create you filtered report / pdf per user.

All these steps are clearly shown on this forum with dozens of examples.
If you get stuck post up the code you have and any error messages and you get help.
 
Thank you Minty. I will try the method you have suggested and update.
 

Users who are viewing this thread

Back
Top Bottom