Passing variables to a popup Form

davesmith202

Employee of Access World
Local time
Today, 22:42
Joined
Jul 20, 2001
Messages
522
I have a main Form that contains a few variables. I want to click a command button and popup another Form and pass some variables across to this Form.

How do I do that?
 
Declare them 'Public' in the general section of a standard module.
 
Ahh yes of course! Thanks.

Can I also ask another question...

I have a continuous Form that pops up. How can I set a specific field to the public variable?

Currently, I have Me.Title_1 = strGlobalKeyword and that is triggered OnCurrent.

However, when I look at the Form, it only populates Title_1 on the first record. How can I set it up so it does it for all records?
 
Hum...

I don't know why you can't set the default value of a text box to the value of a public variable...
 
The reason is I have to run some code to check that the public string is not too long for the field. If it is, I modify it in code and then put the value in.
 
Strange...when I click the command button, I have the following code:

strTitleValue = [Title_1]
MsgBox strTitleValue

...where Title_1 is a field. It says "Invalid use of null" and there doesn't seem to be a value in Title_1.

Why is this? Is the code being triggered before the Form has fully loaded and therefore it cannot see the values?

I've been trying all sorts of events. Currently it is On Load!

Thanks,

Dave
 

Users who are viewing this thread

Back
Top Bottom