why can't "public txtWrk_From as string" be found in another modu.

E

Eagleman

using Access 2007 trial, I have declared

public txtWrk_From as string

in the GENERAL area of a form and I expect to use access that variable in
another form as

me![From] = txtWrk_From

me![from] is a text table item

I thought scope of "public" declared items was the entire project.

John P
 
M

Marshall Barton

Eagleman said:
using Access 2007 trial, I have declared

public txtWrk_From as string

in the GENERAL area of a form and I expect to use access that variable in
another form as

me![From] = txtWrk_From

me![from] is a text table item

I thought scope of "public" declared items was the entire project.


That's true for standard modules. For class modules,
including form/report modules, A module level Public
variable is a property of the class. That means you need to
use the syntax:

Me![From] = Forms!theform.txtWrk_From
 

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