Microsoft
Software
Hardware
Network
Question : Use Variable to address a control
I have two subforms, each with a command button called "cmdAddNewRecord". I refer to these form the main form. Rather than having the same code to refer to each, I want to declare the form name as a vaiable and use the variable in the code
The code is:
Me.frmProfile.Form!cmdAddN
ewRecord.V
isible = True
What I would like to is:
dim FormName as string
FormName = "frmProfile"
and then change the code to:
FormName.Form!cmdAddNewRec
ord.Visibl
e = True
But Access does not like this!
What is the correct syntax?
Answer : Use Variable to address a control
You would do it like this:
Forms(FormName).Form.cmdAd
dNewRecord
.Visible = True
Note that you refer to a "main" form differently than you do a Subform.
Random Solutions
0x0000007B (0xBA4C3524, 0xC0000034, 0x00000000, 0x00000000)
After Update in Access
how to control the veiw of a subreport?
Finding Duplicate rows in a datatable to mark as duplicate and have to append the duplicate row in new datatable
DHCP Server Service won't start
vfp 9.0 line spacing
Vista file sharing across an Access Point / Network merging, etc.
Autodiscover
The SQL Server cannot obtain a LOCK resource at this time
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI<wbr />_AS" and "Latin1_General_CI_AS" in the equal to operation