May 14 2012, 06:16 PM
I have a database with a main form "Order Entry" and one sub form "flights". I am attempting to set the properties of controls on the sub form during the subforms load event.
When the form loads I get an error that says the control either doesn't exist or the name is misspelled. I can run the same code from a command button on the subforms but I can't getting to work using the load event.
I know it has something to do with the way I am referencing the controls but I can't work it out. I am looking for an example of code to change the properties of a control on a subform using the load or on current event.
May 14 2012, 06:17 PM
FYI. I am using Access 2007.
May 14 2012, 06:24 PM
Have a look here
for the correct syntax for referencing forms/subforms (and reports). Depending on what you're doing you may need to put your code in the main forms load or open event and not the subs
May 17 2012, 02:23 PM
I have tried using every option from the info you sent me and nothing works in Access 2007. I created a new DB in access 2010 and used the subform load event to change properties on a control on the subform and it works fine in Access 2010. But when I open it in Access 2007 the error says the control is missing or mispelled. I am attaching the sample I created for anyone who can help to see.
May 17 2012, 03:29 PM
Just FYI there's no attachment to your post. Attachments need to be zipped and less than 2meg before uploading
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here