pass value between forms

Bee

Registered User.
Local time
Today, 15:09
Joined
Aug 1, 2006
Messages
487
Hi,

I want to pass a value between two forms. I created a text field in one of the forms and tried to access it using:

aVariable = frmSearch.txtQryName.Text

It's not working for me. Is this correct?

Thank you,
B
 
Try the following

aVariable = form_frmSearch.txtQryName
 
allan57 said:
Try the following

aVariable = form_frmSearch.txtQryName
No, it did not work.
 
Are you opening the second form after the value is filled in on the first form? If so, try using the OpenArgs parameter in the call to the second form.
 
Personally, I always store variables I need to reference between forms in modules, as public variables, rather than directly reading form references (unless I'm dealing with a form/subform relationship.


in a module

public gblvar as whatevertype

then just use gblvar anywhere its needed
 
gemma-the-husky said:
Personally, I always store variables I need to reference between forms in modules, as public variables, rather than directly reading form references (unless I'm dealing with a form/subform relationship.


in a module

public gblvar as whatevertype

then just use gblvar anywhere its needed
That's great. I did not realize how easy it was.
Thank you very much gemma-the-husky:)
 

Users who are viewing this thread

Back
Top Bottom