Getting data from closed forms

andsweet

New member
Local time
Today, 12:17
Joined
Feb 9, 2007
Messages
6
I have a form which I am trying to get information displayed from another form which is not opened. The unopened form contains text. I need to display this text on the main form which contains a subform. I have tried to enter the path which I think is correct however I still get #NAME or #Error in the text box. Any ideas?
 
The unopened form contains text.
No it doesn't. The text on a form comes from either a recordset that is loaded when the form opens, or code that populates the controls when the form is loaded. There is nothing there if the form isn't open. If you want to take data from that form, it must remain open. You can hide it, but it must remain open. Or, you can assign the value you want to a PUBLIC variable (create a standard module -NOT FORM MODULE) and declare a variable like
Public strMyText As String
in the General Declarations section of the module and then you can assign a value to it and retreive it from anywhere in your project.
 

Users who are viewing this thread

Back
Top Bottom