kmolmstead
New member
- Local time
- Today, 06:08
- Joined
- May 27, 2020
- Messages
- 22
Issue I have a Main form and a main Subform, with that subform have two additional subforms. Both the subsubforms have controls on them all of which I want to manipulate, make visisble etc.
Main form is frm_SuperValidation, Main Subform is subfrm_ScenBal_Valid, with two subforms of that form subform_SuperValid and subfrm_SuprValidChkBox
The code that is causing me the problem is running on the Main subform, and its dealing with the two subforms. during the Current event of the main Subform.
I have a bunch of code that set things to not visible on one of the two subforms.
The scope has not changed still on the subfrom_ScenBal_Valid which both of these are member of at the same level.
Why does the first one work and the second one fails?
I have tried a lot of different configurations to get it to work like:
This form did work before without issues. The most recent change I made was I changed the record set of the main subform "subfrm_ScenBaal_Valid" from a record source based on a table to an SQL generated recordset that is created at runtime and set via the first On Open statement that fires in the chain of events when the entire form is opened. I don't think that is the issue, but it only broke after I made the change so maybe? But the code is just hiding/unhiding controls.
Any help would be most appreciated.
Main form is frm_SuperValidation, Main Subform is subfrm_ScenBal_Valid, with two subforms of that form subform_SuperValid and subfrm_SuprValidChkBox
The code that is causing me the problem is running on the Main subform, and its dealing with the two subforms. during the Current event of the main Subform.
I have a bunch of code that set things to not visible on one of the two subforms.
Code:
Me.Form![subfrm_SuperValid]!Af616EndBal.Enabled = False ' executes just fine no error'
'This is the last line of about 30 entries like this for different controls all execute fine
'This is the next line and fails with "You entered an expression that has an invalid reference to the property Form/Report."
Me.Form![subfrm_SuprValidChkBox]!btn_View_Cert.Enabled = False'
The scope has not changed still on the subfrom_ScenBal_Valid which both of these are member of at the same level.
Why does the first one work and the second one fails?
I have tried a lot of different configurations to get it to work like:
Code:
Forms("frm_SuperValidation").Controls("subfrm_ScenBal_Valid").Form.Controls("subfrm_SuprValidChkBox").form.controls("btn_View_Cert").Enabled = False
'Failed with same error
'I used the builder function in a query to get this'
[Forms]![frm_SuperValidation]![subfrm_ScenBal_Valid]![subfrm_SuprValidChkBox]![Form].[btn_View_Cert].Enabled = False
'Same error'
This form did work before without issues. The most recent change I made was I changed the record set of the main subform "subfrm_ScenBaal_Valid" from a record source based on a table to an SQL generated recordset that is created at runtime and set via the first On Open statement that fires in the chain of events when the entire form is opened. I don't think that is the issue, but it only broke after I made the change so maybe? But the code is just hiding/unhiding controls.
Any help would be most appreciated.
Last edited: