How to Load a Form into Memory without showing it?

vtrm

Registered User.
Local time
Tomorrow, 01:45
Joined
Jun 8, 2005
Messages
21
How can I Load a Form into Memory without showing it?

I have a DB with some Forms. None of them are open. I want to check some properties of each form without actually opening them. How can I do this. Probably by loading it.
Can anybody tell me how to use the LOAD command to load the Form?:o
 
Code:
DoCmd.OpenForm "MyFormName"
To make it invisible include this line afterwards:
Code:
[Forms]![[I]MyFormName[/I]].Visible = False
You can make it visible again by changing this to true

To refer to controls you can use something like:
Code:
[Forms]![[I]MyFormName[/I]]![[I]MyControlName[/I]].[I]Property[/I]
for a property or simply
Code:
[Forms]![[I]MyFormName[/I]]![[I]MyControlName[/I]]
To retrieve the value.

Bobadopolis
 
Just
[Forms]![MyFormName].Visible = False
should load the form and make it invisible. I use this frequently in my database to make sure that the users can only see one form at a time without having to close and reopen things.
 
Some more help

Opening the Form creates some problems. Because I have some script written in the Form_Open() Event which gives error when opened.

I have some Main Forms and some Forms for Data Entry. For eg., frmmain1, & frmmain1_entry, frmmain2 & frmmain2_entry.

The "_entry" forms are called from a cmdbutton press in their respective main forms. Also, I am passing some OpenArgs in the button press of Main form to the dataentry form. So, the frmmain1_entry & frmmain2_entry forms can be opened only by presseing the command buttons in frmmain1 & frmmain2 forms respectively.

If I open these "_entry" forms from any other form other than their related mainfrms, I will get error.

CAN ANYONE TELL ME HOW TO USE THE "LOAD" COMMAND. I READ THE HELP BUT IT DOESN'T EXPLAIN MUCH.
I TRIED LOAD "frmmain1", BUT IT GIVES SYNTAX ERROR...

ANY HELP MUCH APPRECIATED.......
 
workmad3 said:
Just
[Forms]![MyFormName].Visible = False
should load the form and make it invisible.
Well I didn't know that - you learn something new everyday (or lots of new things if you're a dummy like me!) :)

vtrm - I have not used the 'Load' function before but at first sight it looks like it will not do what you want. I think you'll definitely be wanting to use the code we've suggested - you may just have to rethink a little about how you're db operates ;)

HTH,

Bobadopolis
 

Users who are viewing this thread

Back
Top Bottom