S
Stuart
Hello All -
I am using VB.NET 2003 to automate Access XP. Specifically, I am trying to
print out an Access report. The report I want to print is based on a
parameterized query:
PARAMETERS [the code] Long;
SELECT * FROM [Absence Codes]
WHERE AbsenceCode = [the code];
I found an article in the MS KB entitled "HOW TO: Automate Microsoft Access
From Visual Basic .NET" [1] which provided an excellent start. When I click
the "Go!" button, Access presents me with a parameter input box for "[the
code]" and
everything works as expected.
However, I don't want any parameter input boxes popping up; I want to
provide the
parameter programmatically, presumably in my "DoCmd.OpenReport" call. This
should be a piece of cake,
but I can't seem to get it. Here's my OpenReport [2] call:
oAccess.DoCmd.OpenReport(sReport, , , "[the code] = 1")
The parameter input box still pops up. I don't get it. I've tried every
variation I can dream up.
Can anyone please provide some guidance here?
Thanks,
Stuart Laughlin
http://www.bistrotech.net
[1] http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q317113
[2] The "OpenReport" method accepts the following arguments; all but the
first are optional:
ReportName
View
FilterName
WhereCondition
WindowMode
OpenArgs
I am using VB.NET 2003 to automate Access XP. Specifically, I am trying to
print out an Access report. The report I want to print is based on a
parameterized query:
PARAMETERS [the code] Long;
SELECT * FROM [Absence Codes]
WHERE AbsenceCode = [the code];
I found an article in the MS KB entitled "HOW TO: Automate Microsoft Access
From Visual Basic .NET" [1] which provided an excellent start. When I click
the "Go!" button, Access presents me with a parameter input box for "[the
code]" and
everything works as expected.
However, I don't want any parameter input boxes popping up; I want to
provide the
parameter programmatically, presumably in my "DoCmd.OpenReport" call. This
should be a piece of cake,
but I can't seem to get it. Here's my OpenReport [2] call:
oAccess.DoCmd.OpenReport(sReport, , , "[the code] = 1")
The parameter input box still pops up. I don't get it. I've tried every
variation I can dream up.
Can anyone please provide some guidance here?
Thanks,
Stuart Laughlin
http://www.bistrotech.net
[1] http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q317113
[2] The "OpenReport" method accepts the following arguments; all but the
first are optional:
ReportName
View
FilterName
WhereCondition
WindowMode
OpenArgs