S
scottyboyb
Greetings,
Here is probably a simple puzzle. I have a form with two Form_Current()
events in it. I think one is not playing well with the other. The form has a
command button that opens a subform filtered to the main form's data. That is
working perfectly. I also have an If statement that hides or reveals a text
box based on a check box being true or false. I have this If statement in
another form and it works perfectly there, but here the form opens with the
text box visible with the check both false. I think it has to do with the
Form_Current_Exit: and Exit Sub lines in the code. Am I correct and if so
what do I do about it? If I am not correct, then does anyone have a suggstion
of what might be wrong? If I am wrong, will I need to post the rest of the
form's code for the ChildForm opening and closing and filtering?
Thanks,
Scott
Here is the code for Form_Current():
Sub Form_Current()
On Error GoTo Form_Current_Err
If ChildFormIsOpen() Then FilterChildForm
Form_Current_Exit:
Exit Sub
If Me!chkBoardMember = False Then
Me!txtPosition.Visible = False
Me!txtPosition.Value = ""
Else
Me!txtPosition.Visible = True
End If
Form_Current_Err:
MsgBox Error$
Resume Form_Current_Exit
End Sub
Here is probably a simple puzzle. I have a form with two Form_Current()
events in it. I think one is not playing well with the other. The form has a
command button that opens a subform filtered to the main form's data. That is
working perfectly. I also have an If statement that hides or reveals a text
box based on a check box being true or false. I have this If statement in
another form and it works perfectly there, but here the form opens with the
text box visible with the check both false. I think it has to do with the
Form_Current_Exit: and Exit Sub lines in the code. Am I correct and if so
what do I do about it? If I am not correct, then does anyone have a suggstion
of what might be wrong? If I am wrong, will I need to post the rest of the
form's code for the ChildForm opening and closing and filtering?
Thanks,
Scott
Here is the code for Form_Current():
Sub Form_Current()
On Error GoTo Form_Current_Err
If ChildFormIsOpen() Then FilterChildForm
Form_Current_Exit:
Exit Sub
If Me!chkBoardMember = False Then
Me!txtPosition.Visible = False
Me!txtPosition.Value = ""
Else
Me!txtPosition.Visible = True
End If
Form_Current_Err:
MsgBox Error$
Resume Form_Current_Exit
End Sub