Report question

M

mosquitooth

Hi

in one of my access reports, I created a textbox, that
shall be filled with data, when the report appears. The
data to show is stored in a public/ global var that is
declared in a module. Now, I tried to implement this in
the Report_Open handler as following:

TextBox1.SetFocus
TextBox1.Text = myglvar

But all that happens is, that access denies this two
expressions.

How can I solve this??

mosquitooth
 
J

Jeff Boyce

Open the report in design mode. Open the properties window for the textbox.
Look for the control source property. Add something like the following as
the textbox's control source:

=get_myglvar()

NOTE: you will first have to create a function in a code module that
returns the value of your global. Since you've already declared the
variable in a module, just add a new function (get_myglvar()) that returns
it. The reason you'll need to do this is because you have to use (if I
remember correctly) a function, not a public variable, in a control source.

Good luck

Jeff Boyce
<Access MVP>
 

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