R
RobUCSD
The code below causes the nasty "Error 94(Invalid Use of Null in procedure
Form_Current of VBA Doc Form_frmVisitNewEdit. It happens when changing
patients, or when going to a patient that has now visits.
I looked at previous posts and I made sure that there is no conflict with
the AllowEdits properties of the forms. If I comment out the code below I
don't get the error msg, but then I also don't get the use of the code I'm
using to select an appropriate pg.
As always, your help is greatly appreciated. Thanks, Rob
*******************************************************
Private Sub Form_Current()
On Error GoTo Form_Current_Error
Me.Refresh
Dim T_Visit As String
T_Visit = Me.fldVisitType
'first hide all controls
Me.pgAblations.Visible = False
Me.pgCardioversions.Visible = False
Me.pgClinicVisits.Visible = False
Me.pgDevices.Visible = False
Me.pgTilts.Visible = False
Me.pgTelephone.Visible = False
'now show one control
Select Case T_Visit
Case "Ablation"
Me.pgAblations.Visible = True
Case "Device"
Me.pgDevices.Visible = True
Case "Clinic"
Me.pgClinicVisits.Visible = True
Case "Cardioversion"
Me.pgCardioversions.Visible = True
Case "Telephone"
Me.pgTelephone.Visible = True
Case "Tilt Table"
Me.pgTilts.Visible = True
End Select
Me.lstVisit.SetFocus
On Error GoTo 0
Exit Sub
Form_Current_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
Form_Current of VBA Document Form_frmVisitNewEdit"
End Sub
Form_Current of VBA Doc Form_frmVisitNewEdit. It happens when changing
patients, or when going to a patient that has now visits.
I looked at previous posts and I made sure that there is no conflict with
the AllowEdits properties of the forms. If I comment out the code below I
don't get the error msg, but then I also don't get the use of the code I'm
using to select an appropriate pg.
As always, your help is greatly appreciated. Thanks, Rob
*******************************************************
Private Sub Form_Current()
On Error GoTo Form_Current_Error
Me.Refresh
Dim T_Visit As String
T_Visit = Me.fldVisitType
'first hide all controls
Me.pgAblations.Visible = False
Me.pgCardioversions.Visible = False
Me.pgClinicVisits.Visible = False
Me.pgDevices.Visible = False
Me.pgTilts.Visible = False
Me.pgTelephone.Visible = False
'now show one control
Select Case T_Visit
Case "Ablation"
Me.pgAblations.Visible = True
Case "Device"
Me.pgDevices.Visible = True
Case "Clinic"
Me.pgClinicVisits.Visible = True
Case "Cardioversion"
Me.pgCardioversions.Visible = True
Case "Telephone"
Me.pgTelephone.Visible = True
Case "Tilt Table"
Me.pgTilts.Visible = True
End Select
Me.lstVisit.SetFocus
On Error GoTo 0
Exit Sub
Form_Current_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
Form_Current of VBA Document Form_frmVisitNewEdit"
End Sub