G
Guest
I have the following code set up. The comments give a fairly good idea of
what I am trying to achieve. The problem is that, when I first go into the
form, more often than not, if the check box is ticked, the details label and
combo box don't display. I can only get them to display by unchecking and
rechecking. I think it's the OnActivate event that's causing the problem. Is
there anything I'm missing or have I used the wrong event?
' On opening the form, checks the status of chkFatigueMedication to
determine whether to
' display the details label and box.
Private Sub Form_OnActivate()
If Me.chkFatigueMedication = -1 Then
Me.lblBowelMedicationDetails.Visible = True
Me.memBowelMedication.Visible = True
End If
' After check box has been updated,
' if it has been checked, the details label and box will be displayed
' if it has been unchecked , the details label and box will be hidden and
the contents
' of the details box deleted.
Private Sub chkFatigueMedication_AfterUpdate()
If Me.chkFatigueMedication <> 0 Then
Me.lblFatigueMedicationDetails.Visible = True
Me.memFatigueMedication.Visible = True
Else
Me.lblFatigueMedicationDetails.Visible = False
Me.memFatigueMedication.Visible = False
Me.memFatigueMedication.Value = Null
End If
End Sub
Kind regards
Tony
what I am trying to achieve. The problem is that, when I first go into the
form, more often than not, if the check box is ticked, the details label and
combo box don't display. I can only get them to display by unchecking and
rechecking. I think it's the OnActivate event that's causing the problem. Is
there anything I'm missing or have I used the wrong event?
' On opening the form, checks the status of chkFatigueMedication to
determine whether to
' display the details label and box.
Private Sub Form_OnActivate()
If Me.chkFatigueMedication = -1 Then
Me.lblBowelMedicationDetails.Visible = True
Me.memBowelMedication.Visible = True
End If
' After check box has been updated,
' if it has been checked, the details label and box will be displayed
' if it has been unchecked , the details label and box will be hidden and
the contents
' of the details box deleted.
Private Sub chkFatigueMedication_AfterUpdate()
If Me.chkFatigueMedication <> 0 Then
Me.lblFatigueMedicationDetails.Visible = True
Me.memFatigueMedication.Visible = True
Else
Me.lblFatigueMedicationDetails.Visible = False
Me.memFatigueMedication.Visible = False
Me.memFatigueMedication.Value = Null
End If
End Sub
Kind regards
Tony