S
SusanV
I have an Access report based on the following user-input query:
''''''''''''''''''''
SELECT AO.PMQA, AO.Title, AO.Completed, AO.SentSSI, AOLCode.LCode,
LSGCode.TITLE, LSGCode.NARR, LSGCode.ManHours, LSGCode.[L-CauseCode],
LSGCode.AUTH
FROM LSGCode INNER JOIN (AO INNER JOIN AOLCode ON AO.PMQA = AOLCode.PMQA) ON
LSGCode.LSGCODE = AOLCode.LCode
WHERE (((AO.PMQA) Like [Enter the Report Number (1-52 NOT 001-052)]));
''''''''''''''''
This works fine when the user needs just that specific report, but there is
a "set" of reports they are required to generate weekly.
The other Access reports are based on queries similar to this, and always
the user-input is the same criteria - AO.PMQA (referred to as "Report
Number"). Users need all the reports related to the input "Report Number" at
the same time. As they have to output 4 different reports, based on between
5 and 10 different "Report Numbers," they are complaining about having to
enter the Report Number over and over. Can't say as I blame them there!
How can I get the value of AO.PMQA (which is an autonumber field and the PK)
as a variable and pass it to VBA for use in DoCmd OutputTo acReport... ?
This way they can enter the "Report Number" once, get all the snapshot files
they need, then enter another "Report Number" for the next recordset and so
on.
Sorry if this seems like a simple thing, but I've searched the web and the
groups and can't seem to get anything I find to work. For example:
'''''''''''''''
Dim Rep As Integer
Rep = "SELECT PMQA FROM AO WHERE PMQA Like [Enter the Report Number];"
''''''''''''''''
Error is "Type Mis-match."
Change var Rep to String and the var actually hold the SQL statement, which
is useless, I need the var to hold the value of the field, numeric 1-52.
Frustrating... and probably right in front of my nose!
TIA,
SusanV
''''''''''''''''''''
SELECT AO.PMQA, AO.Title, AO.Completed, AO.SentSSI, AOLCode.LCode,
LSGCode.TITLE, LSGCode.NARR, LSGCode.ManHours, LSGCode.[L-CauseCode],
LSGCode.AUTH
FROM LSGCode INNER JOIN (AO INNER JOIN AOLCode ON AO.PMQA = AOLCode.PMQA) ON
LSGCode.LSGCODE = AOLCode.LCode
WHERE (((AO.PMQA) Like [Enter the Report Number (1-52 NOT 001-052)]));
''''''''''''''''
This works fine when the user needs just that specific report, but there is
a "set" of reports they are required to generate weekly.
The other Access reports are based on queries similar to this, and always
the user-input is the same criteria - AO.PMQA (referred to as "Report
Number"). Users need all the reports related to the input "Report Number" at
the same time. As they have to output 4 different reports, based on between
5 and 10 different "Report Numbers," they are complaining about having to
enter the Report Number over and over. Can't say as I blame them there!
How can I get the value of AO.PMQA (which is an autonumber field and the PK)
as a variable and pass it to VBA for use in DoCmd OutputTo acReport... ?
This way they can enter the "Report Number" once, get all the snapshot files
they need, then enter another "Report Number" for the next recordset and so
on.
Sorry if this seems like a simple thing, but I've searched the web and the
groups and can't seem to get anything I find to work. For example:
'''''''''''''''
Dim Rep As Integer
Rep = "SELECT PMQA FROM AO WHERE PMQA Like [Enter the Report Number];"
''''''''''''''''
Error is "Type Mis-match."
Change var Rep to String and the var actually hold the SQL statement, which
is useless, I need the var to hold the value of the field, numeric 1-52.
Frustrating... and probably right in front of my nose!
TIA,
SusanV