D
Dinosaur
When I was learning, a book on Access 2000 suggested one way of transferring
information from a VBA module to a report was to set a field's control source
to reference a public variable in the module. So, for example, I had "Public
strPrint as String" in a module and then assigned to strPrint the value to be
printed. In the report textbox's control source, I put "=[strPrint]" (less
quotes) and everything worked just fine.
I just installed Access 2003 and this technique no longer works. All the
textboxes show "#Name?". Poring through documentation and several forums for
a few hours, it appears the rules have changed -- a control source can
reference a public function in a module, but not a variable.
Am I interpreting this correctly or is there something else going on
(libraries, using the wrong incense, whatever)?
I realize a workaround would be to write a "get" function for each such
variable or to write to a field directly from the module but, before doing
that, I want to verify it's necessary. I have 13 reports with 10-30 such
variables for each report and it'll take quite a while to do.
Thanks for any help.
Dan Dinosaur
information from a VBA module to a report was to set a field's control source
to reference a public variable in the module. So, for example, I had "Public
strPrint as String" in a module and then assigned to strPrint the value to be
printed. In the report textbox's control source, I put "=[strPrint]" (less
quotes) and everything worked just fine.
I just installed Access 2003 and this technique no longer works. All the
textboxes show "#Name?". Poring through documentation and several forums for
a few hours, it appears the rules have changed -- a control source can
reference a public function in a module, but not a variable.
Am I interpreting this correctly or is there something else going on
(libraries, using the wrong incense, whatever)?
I realize a workaround would be to write a "get" function for each such
variable or to write to a field directly from the module but, before doing
that, I want to verify it's necessary. I have 13 reports with 10-30 such
variables for each report and it'll take quite a while to do.
Thanks for any help.
Dan Dinosaur