DLookup and form events

J

Junior

Need advice -please excuse if my terms are incorrect
I'm setting a global (public) variable using a cbo box on Form1 after update
using this code

Me.Requery
IntAdd = DLookup("PAdd", "tblProfSusp")

and also in the Main form Onopen event
IntAdd = DLookup("PAdd", "tblProfSusp")

the Main form is always open - sometimes hidden
do i need to put code elsewhere?
or is there a better solution -
IntAdd is used in several functions
 
S

Steve Schapel

Junior,

I guess you need to put code to refresh the value of the variable in any
case where the value of PAdd in the table can be changed. If Form1 is
the only place where this can happen, I guess you've got it covered.
 
J

Junior

Thaks Steve - i get confused with events-
didn'tt know if on current needed the code?
 

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