Referencing forms from other forms ?

liamfitz

Registered User.
Local time
Today, 23:02
Joined
May 17, 2012
Messages
240
This link in FAQ http://access.mvps.org/access/forms/frm0031.htm , suggests the following format, to reference a mainform's control's property from another form ...
Code:
Forms!Mainform!Controlname.property

However I continually get, " Cannot find the referenced form (formname )". I've tried several Mainforms, and the spelling/case of letters, is definitely correct. Could it be the syntax ?
:confused:
 
Do you have spaces in your form name, if so you may need to use square brackets
 
I found this page most helpful when becoming comfortable with referring to controls on forms.

http://access.mvps.org/access/forms/frm0031.htm

I prefer not to use the ! deliminator syntax, and instead use function () type syntax:

Code:
    'Refresh the prior window UI
    Call Forms("adminauth").Refresh_Click(intAuthID)
So, this LOC reaches into the Forms collection and looks for a form named "adminauth", once found it sends that form the Refresh_Click event a message to be run, passing it one arg intAuthID.
 
Greetings

Please provide the name of the form and then the name of the control and the property you'd like to change?
 
My command line is ...

Code:
Forms!frmAfAIS(test)!lblTest.Caption

I take the point about 'miscellaneous' characters - maybe the brackets are an issue. I'll ltry the SQUARE Brackets technique. Thank you.
:o
 
I've changed the form's name, and now it works ( no special characters ! ) Thank you.
 

Users who are viewing this thread

Back
Top Bottom