I have a series of forms based on queries. Each of these queries have the same parameter ("Product ID"), but pulls from different tables. The purpose of these different forms is to pull product specifications from their respective tables.
In a userform, I prompt the user for the parameter "Product ID" to run on a check on the last time the specs were reviewed. If the review date is recent enough, it allows the specs to be printed.
The problem I have, is that each time I got to print one of the reports, it asks for the parameters again. I would like to pass the parameter the user input when opening the form to each of the reports when they open. This would cut out about 5 pop up boxes.
Help!
Curtis,
First, it sounds like the Query supporting the Report is looking for Product ID, but that value is not actually available, so, you are simply telling the Report what to look for. Try to drill down to the query first.
Along those same lines, if you want to limit the query based on the value entered by the User, as one of the criteria in your query, you can use the value entered on the form like such: - WHERE [Product_ID] = Forms![FormName]![txtProduct_ID]
This will allow the Report to print just the records associated with that Product ID.
Hope this hepps!
4 1018
Curtis,
First, it sounds like the Query supporting the Report is looking for Product ID, but that value is not actually available, so, you are simply telling the Report what to look for. Try to drill down to the query first.
Along those same lines, if you want to limit the query based on the value entered by the User, as one of the criteria in your query, you can use the value entered on the form like such: - WHERE [Product_ID] = Forms![FormName]![txtProduct_ID]
This will allow the Report to print just the records associated with that Product ID.
Hope this hepps!
Hi Twinnyfo,
Thanks for your answer.
So the Form (frmPrintCheck) pulls in a query (qryMMO) to get a value (ReviewDate) from that query to check when the most recent review was. Because of this, opening the form requires providing the parameter (ProductID) to the query (qryMMO).
After the review check, a series of Forms are opened the reference a series of queries, including qryMMO. Despite this, you have to re-enter the parameter.
I've tried making relationships, etc. to tie these queries together.
So i've tried to provide the WHERE criteria in the open report code: - DoCmd.OpenReport "rptSpecs", acViewPreview,,[Product ID]=Me.[Product ID]
but that doesn't seem to change anything. Thoughts?
I think I figured out what you meant just now twinnyfo...
I went to the query and changed the criteria for [Product ID] to pull directly from the form itself.
Thank you so much!
Here's an idea, which I think will work:
In a separate, stand-alone module, establish a Global Variable and a quickie Function to use that variable in Queries: - Option Compare Database
-
Option Explicit
-
-
Public gProductID as [whatever data type the Product ID is]
-
-
Public Function ProductID() as [whatever data type the Product ID is]
-
ProductID = gProductID
-
End Function
When the Form opens, ask the user to select the Product ID, in whatever method you desire. After the Product ID is selected or identified, establish the value of the Global Variable: - gRpoductID = me.txtProductID [or however you have established to set the Product ID]
Now, go back to the Query used for the Record Source for your Report. In the Product ID Field, in the Criteria, use this:
This should limit the records to only that Product ID.
Hope you understand this and that it hepps.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Bob M |
last post by:
I've been trying to find a freeware front end to the MySQL database to
create reports based on queries, and some sort of front-end which I can
format for other users to use to load data into the...
|
by: Zentil |
last post by:
While printing reports Spooling of print document size get increased into
larger size ie the document size is 260kb but on spooling it increased to
268mb. but this is happening in some systems...
|
by: JayCallas |
last post by:
I know this question has been asked. And the usual answer is don't use
cursors or any other looping method. Instead, try to find a solution
that uses set-based queries.
But this brings up...
|
by: wojtek |
last post by:
Hello,
I have a task to create set of reports based on data from TFS source control.
I must create these reports using reporting services technology.
|
by: crusoe |
last post by:
I have some queries which return rowsets. I want to make XHTML tables from these sets in a single report file.
My preliminary solution is a procedure, which returns varchar(8000) containing XHTML...
|
by: josur |
last post by:
Hi,
I would like to know if is possible to create dynamic reports based on cubes. What i mean is,after creating a cube with a couple of dimensions and measure if is there any way to give the...
|
by: kv29 |
last post by:
Hi everyone! I really hope my problem will be a piece of cake for an expert coder :)
I have a table with 100 records, and I need to print them all between 10 different reports based on each...
|
by: CK |
last post by:
How do I write a set based query? I have a groupSets table with fields
setId, idField, datasource, nameField, prefix, active
Data:
1,someIDfield, someTable, someField, pre1, 1
2,someotherIDfield,...
|
by: jdoathout |
last post by:
I have a database that needs to be deployed to a kiosk for civilian drivers. The Data is HIPPA Related and needs to be restricted to that individuals needs. However it all has to come together in...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| | |