Print variable values

  • Thread starter Thread starter Ice Man
  • Start date Start date
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
 
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
 
Back
Top