Hi,
I have a mainform with some sub forms, I want to hide the sub forms until a text box on the main form has been filled in.
So I've tried this on my main form
and then put this on the afterupdate of the field I wanted to be filled
But it's not working right, I already had some data in the table, and when it opens the form, the records that had data the sub forms display fine. I then create a new record, and the sub forms disappear just like they are suppose too. but when I put something in the txtbox, they don't reappear. And then if I go back a record (which displayed earlier), they still don't reappear.
So the after update event doesn't seem to be working? Anyone see what I'm doing wrong? Should I put that code in a different event?
Basically what I want it to do is, if txt_Start_Date is empty don't show the subforms, if there is something in that field display them.
I have a mainform with some sub forms, I want to hide the sub forms until a text box on the main form has been filled in.
So I've tried this on my main form
Code:
Private Sub Form_Current()
If Me.NewRecord Then
Me![frm_criteria2].Visible = False
Me![DX_subform].Visible = False
End If
End Sub
and then put this on the afterupdate of the field I wanted to be filled
Code:
Private Sub txt_Start_Date_AfterUpdate()
Me![frm_criteria2].Visible = True
Me![DX_subform].Visible = True
End Sub
But it's not working right, I already had some data in the table, and when it opens the form, the records that had data the sub forms display fine. I then create a new record, and the sub forms disappear just like they are suppose too. but when I put something in the txtbox, they don't reappear. And then if I go back a record (which displayed earlier), they still don't reappear.
So the after update event doesn't seem to be working? Anyone see what I'm doing wrong? Should I put that code in a different event?
Basically what I want it to do is, if txt_Start_Date is empty don't show the subforms, if there is something in that field display them.