Set TAG property before opening Report

T

TC

Frank B said:
Before opening a report I want to set the contents of the
report's TAG property to either "A" or "B". When the
Report is Opened, the TAG value then can be used for a VBA
decision in the report's OnActivate event. How would I
set the TAG property before the Report is opened?
Thanks.... Frank


Why not just declare a global variable in a standard module & pass the value
through that?

HTH,
TC
 
F

Frank B

Before opening a report I want to set the contents of the
report's TAG property to either "A" or "B". When the
Report is Opened, the TAG value then can be used for a VBA
decision in the report's OnActivate event. How would I
set the TAG property before the Report is opened?
Thanks.... Frank
 
F

Frank B

Thanks TC. I thought about using a Field in a form, but a
Global would certainly be less effort.

Anyway, because it has me puzzled, I would still like to
know how to set that TAG field before activating the
report. Is it possible to open a report without activating
it (other than design mode)? I guess I could open it in
design, set TAG, close it, then activate it. Kinda
kludgey. Thanks your your thoughts.... Frank
 
J

JohnFol

or just use the OpenArgs on the OpenReport.

expression.OpenReport(ReportName, View, FilterName, WhereCondition,
WindowMode, OpenArgs)



Then in the report you can detect what was passed using Me.OpenArgs rather
than Tag values

ie if me.openargs = "B" then. . . . .
 
F

Frank B

Hi, again,

I'm using Acces 2k. Looks like it doesn't support the
OpenArgs on the OpenReport. It does on OpenForm, but that
does me no good. What version of Access supports OpenArgs
on the OpenReport? Thanks... Frank
 
J

JohnFol

Plan B is to reference the original form.

I presume you have a form with a button on that launches the report. On the
report you could do a forsm reference, or if the report is based on a query,
then add it as a field, ie
Select FirstField, SecondField . . .. Forms!FormName!HiddenControlName AS
AorB From . .

Then in the report just check the field value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top