Hi. I have a main form and a sub form.
In my mainfrm I have a text field that is REQUIRED before I can enter any data into the subfrm.
Can anyone help me with this code and how I would relate the two? I know how to do it when all the controls (text fields) are on the same form, but when it's a sub form and a main form then I don't know how to do it anymore.
Help please?
This is what I used for controls that are within the same form.
Private Sub Form_Load()
Me.CellPhone.Visible = False
Me.WorkPhone.Visible = False
End Sub
Private Sub HomePhone_AfterUpdate()
Me.CellPhone.Visible = True
Me.WorkPhone.Visible = True
End Sub
For the codes that I bolded in blue, HOW would I change these to relate to my subform?
I tried this Me!subfrm.Form!ControlName.Enabled and placed this on the On Load of the mainfrm and After Update of the control in the mainfrm, but it didn't work.
In my mainfrm I have a text field that is REQUIRED before I can enter any data into the subfrm.
Can anyone help me with this code and how I would relate the two? I know how to do it when all the controls (text fields) are on the same form, but when it's a sub form and a main form then I don't know how to do it anymore.
Help please?
This is what I used for controls that are within the same form.
Private Sub Form_Load()
Me.CellPhone.Visible = False
Me.WorkPhone.Visible = False
End Sub
Private Sub HomePhone_AfterUpdate()
Me.CellPhone.Visible = True
Me.WorkPhone.Visible = True
End Sub
For the codes that I bolded in blue, HOW would I change these to relate to my subform?
I tried this Me!subfrm.Form!ControlName.Enabled and placed this on the On Load of the mainfrm and After Update of the control in the mainfrm, but it didn't work.
Last edited: