I have a form and have one of the field set to invisible if certain conditions are met and put the code on current event. Something similar to the one shown below:
Private Sub Form_Current()
If [Schedule].Form![Dev_Code] Like "*N*" Then
Me![Schedule].Form![DateOpen1].Visible = True
Else
Me![Schedule].Form![DateOpen1].Visible = False
End If
End Sub
It works well but if the field has the focus, then I get the error message that field cannot be invisible when it has the focus. What is the best way to manage this. Ideally, there should be an event that is triggered before on current event kicks in but I could not find it. I tried dactivate and unload to shift the focus but to no avail. Could someone help?
Cheers
AK
Note: Using Access 97 for back end A2002 for front end.
Private Sub Form_Current()
If [Schedule].Form![Dev_Code] Like "*N*" Then
Me![Schedule].Form![DateOpen1].Visible = True
Else
Me![Schedule].Form![DateOpen1].Visible = False
End If
End Sub
It works well but if the field has the focus, then I get the error message that field cannot be invisible when it has the focus. What is the best way to manage this. Ideally, there should be an event that is triggered before on current event kicks in but I could not find it. I tried dactivate and unload to shift the focus but to no avail. Could someone help?
Cheers
AK
Note: Using Access 97 for back end A2002 for front end.