Print variable values

I

Ice Man

Hi

I got a form with a push button when pressed executes VB code and fill 2
variable with values

for ex

varModel = "A344/TR200"
varSerial = "10007201"

after that I want to print these 2 values in a report without using querries
or tables

How can I do that using VB Code

Regards
 
D

Dean

If you do not have a global module then create one.
In the declaration section at the beginning of the module
declare your variables as public
for ex
Public varModel as string
Public varSerial as string

next create public functions that return the values of
the global variables.
for ex
Public function getModel() as string
getModel = varModel
end function
Public function getSerial() as string
getSerial = varSerial
end function

Now in the control source for each text field on your
report set the control source to the public appropriate
public function.
for example in the text box for the Model:
=getModel()
in the text box for the serial:
=getSerial()

----- Dean
 

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