R
rgrantz
I have a main form with a subform, and in that subform is another subform
(3rd form is linked to 2nd form, 2nd form is linked to main form)
I am trying to, when the user opens the main form, check for a zero-length
string (null value, but it's a text field, which I believe does not support
a null value check) in the subform, and if it is IS zero length, completely
disable the 3rd form (the subform of the subform).
I have put the code in the OnLoad event of the Main form, and have tried:
If Me!Subform1.Form.ControlName.Value Is Null Then
Me!Subform1.Form!Subform2.Form.Visible = False
Else
Me!Subform1.Form!Subform2.Form.Visible = True
End If
I have also tried:
If Me!Subform1.Form.ControlName.Value = "" Then
Me!Subform1.Form!Subform2.Form.Visible = False
Else
Me!Subform1.Form!Subform2.Form.Visible = True
End If
And also
If Me!Subform1.Form.ControlName = "" Then
Me!Subform1.Form!Subform2.Form.Visible = False
Else
Me!Subform1.Form!Subform2.Form.Visible = True
End If
I have also tried moving the sub to different events (ie. setting focus to
the Subform control upon loading the main form (which works), and then using
the GotFocus and LostFocus events to change the visibility or enabling of
the sub-subform. Nothing seems to be working.
My goal here is to, when the Subform's control is blank (ie. new record),
then the sub-subform (the subform's subform) isn't enabled until the subform
control has a value in it.
Is there a way to do this?
Thanks for any help.
(3rd form is linked to 2nd form, 2nd form is linked to main form)
I am trying to, when the user opens the main form, check for a zero-length
string (null value, but it's a text field, which I believe does not support
a null value check) in the subform, and if it is IS zero length, completely
disable the 3rd form (the subform of the subform).
I have put the code in the OnLoad event of the Main form, and have tried:
If Me!Subform1.Form.ControlName.Value Is Null Then
Me!Subform1.Form!Subform2.Form.Visible = False
Else
Me!Subform1.Form!Subform2.Form.Visible = True
End If
I have also tried:
If Me!Subform1.Form.ControlName.Value = "" Then
Me!Subform1.Form!Subform2.Form.Visible = False
Else
Me!Subform1.Form!Subform2.Form.Visible = True
End If
And also
If Me!Subform1.Form.ControlName = "" Then
Me!Subform1.Form!Subform2.Form.Visible = False
Else
Me!Subform1.Form!Subform2.Form.Visible = True
End If
I have also tried moving the sub to different events (ie. setting focus to
the Subform control upon loading the main form (which works), and then using
the GotFocus and LostFocus events to change the visibility or enabling of
the sub-subform. Nothing seems to be working.
My goal here is to, when the Subform's control is blank (ie. new record),
then the sub-subform (the subform's subform) isn't enabled until the subform
control has a value in it.
Is there a way to do this?
Thanks for any help.