DoCmd.OpenReport stDocName, acViewPreview, , stWhere
Reports!SubmittalReport!MainFolderName = me.stFolderName
DoCmd.RepaintObject acReport, "SubmittalReport"
Thanks in advance for any suggestions you may have.
Steve
If you are using Access 2000 or newer, you can pass the value in the
OpenArgs argument:
DoCmd.OpenReport stDocName, acViewPreview, , stWhere, ,
Me!stFolderName
Then in the Report Header Format event:
[MainFolderName] = Me.OpenArgs
If the form is going to remain open when the report is run, you could
also simply refer to the form control in the control source of an
unbound countrol:
=forms!FormName!stFolderName
in which case no additional coding is necessary. Just open the report.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
>.
>
Thanks
Steve
"fredg" <fgut...@example.invalid> wrote in message
news:zbow7eah6m06.s...@40tude.net...
It just requires a bit more work.
Concatenate the c0ontrol values in the open arguments using a comma as
delimiter:
DoCmd.OpenReport stDocName, acViewPreview, , stWhere, ,
Me!stFolderName & "," & Me!SubFolderName
Then in the Report's Report Header Format event:
Dim strString1 as String
Dim strString2 as string
strString1 = left(Me.OpenArgs,InStr(Me.OpenArgs,",")-1)
strString2 = Mid(Me.OpenArgs,InStr(Me.OpenArgs,",")+1)
[MainFolderName] =strString1
[SubFolderName] = strString2
Thanks again.
Steve
"fredg" <fgut...@example.invalid> wrote in message
news:snjwm1nzshf2.1i...@40tude.net...
Any ideas?
Put a hidden textbox on your form. Name it txtstFolderName. In your code,
just before you open the report, write the value of the stFolderName
variable into that textbox. Then use the Open event of the report to read
that value from this textbox on your form.
--
Ken Snell
<MS ACCESS MVP>
"James" <Ja...@discussions.microsoft.com> wrote in message
news:A128F380-B30D-4BE9...@microsoft.com...
You are correct that OpenArgs for Reports is not available in Access 2000.
However, Global Variables are.
I don't like having a report reference a specific form because it eliminates
reusability. I think having the form set a global variable and then having
that report look for that variable (and if it is blank, setting it's own
values) ends up being a much better way of doing things.
Anyway, just my .02.
--
Ken Snell
<MS ACCESS MVP>
"James" <Ja...@discussions.microsoft.com> wrote in message
news:3F35B9BC-0ECC-4EE7...@microsoft.com...