G
Guest
OK, I started searching this board with many questions, and I was able to
find the answers to all but one.
I wanted to made a hidden field visible based on the selection of a option
field. Shifthours visibility is set to No. Here is the code I used:
Private Sub Form_Current()
If Shifthours.Value = 4 Then
OtherExplain.Visible = True
End If
If Shifthours.Value < 4 Then
OtherExplain.Visible = False
End If
If Me.Shifthours.Value = Null Then
Me.OtherExplain.Visible = False
End If
End Sub
Private Sub Frame97_AfterUpdate()
If Me![Shifthours].Value = 4 Then
Me![OtherExplain].Visible = True
End If
If Me![Shifthours].Value < 4 Then
Me![OtherExplain].Visible = False
End If
End Sub
I realize my syntax may not be the simplest, but anyway I was able to get
the field to become visible when Option 4 was selected, and disappear if the
user changed to one of the other choices. Also, I was able to use the Current
code to show the field if user moves to a record where option 4 is selected,
and hide it if it option 4 was not selected.
The problem, is, however, that when the user creates a new record, it
apparently does not use the Current code. If the user moves from a record
where Option 4 was selected, the OtherExplain box remains visible. Any ideas?
find the answers to all but one.
I wanted to made a hidden field visible based on the selection of a option
field. Shifthours visibility is set to No. Here is the code I used:
Private Sub Form_Current()
If Shifthours.Value = 4 Then
OtherExplain.Visible = True
End If
If Shifthours.Value < 4 Then
OtherExplain.Visible = False
End If
If Me.Shifthours.Value = Null Then
Me.OtherExplain.Visible = False
End If
End Sub
Private Sub Frame97_AfterUpdate()
If Me![Shifthours].Value = 4 Then
Me![OtherExplain].Visible = True
End If
If Me![Shifthours].Value < 4 Then
Me![OtherExplain].Visible = False
End If
End Sub
I realize my syntax may not be the simplest, but anyway I was able to get
the field to become visible when Option 4 was selected, and disappear if the
user changed to one of the other choices. Also, I was able to use the Current
code to show the field if user moves to a record where option 4 is selected,
and hide it if it option 4 was not selected.
The problem, is, however, that when the user creates a new record, it
apparently does not use the Current code. If the user moves from a record
where Option 4 was selected, the OtherExplain box remains visible. Any ideas?