String in Form reference thingy

Monsora83

Registered User.
Local time
Today, 11:15
Joined
May 16, 2011
Messages
41
strTableName = Me.Database_Table

strFieldName = Me.Table_Field

[Forms]![" & strTableName & "]![" & strFieldName & "].Visible = Me.Visible

How do I get these string to work in this setting? I feel like I'm missing something real simple.
 
Forms(strTableName).Controls(strFieldName).Visible = Me.Visible
 
Forms(strTableName).Controls(strFieldName).Visible = Me.Visible

Gives me a runtime error 2450....I think access is mocking me...as I am quite certain your right.

/off to google

:confused:

/copypaste of current

strTableName = "Frm_FormName"
strFieldName = "FieldName"
Forms(strTableName).Controls(strFieldName).Visible = Me.Visible
 
Gives me a runtime error 2450....I think access is mocking me...as I am quite certain your right.

/off to google

:confused:

/copypaste of current

strTableName = "Frm_FormName"
strFieldName = "FieldName"
Forms(strTableName).Controls(strFieldName).Visible = Me.Visible


ah... DoCmd.OpenForm stDocName, , , , , acHidden


Have to have the form open to run that code that it referencing to I guess.
/Resolved
 
Yes, it does need to be open in order to reference it.
 

Users who are viewing this thread

Back
Top Bottom