marcuscoker
Registered User.
- Local time
- Today, 06:20
- Joined
- Sep 28, 2005
- Messages
- 49
Hi Was wondering if anybody could help with a select case statement I am using to validate a form
This is the code
Dim myclinic As String
Dim myfname As String
myfname = Me.txtFirstName
myclinic = Me.frmClinic
Select Case myfname
Case Is = Null
MsgBox "Please enter a first name", vbCritical
End Select
Select Case myclinic
Case "1", "2", "3"
DoCmd.Save
DoCmd.Close
DoCmd.OpenForm "switchboard"
Case "0"
MsgBox "Please select a clinic", vbCritical
End Select
When I run this code I get the error
Run-time error '94'
Invalid use of null
The second select case works fine because the default value is 0
If anybody could help me and tell me where I am going worng that would be great
Thank
Marcus
This is the code
Dim myclinic As String
Dim myfname As String
myfname = Me.txtFirstName
myclinic = Me.frmClinic
Select Case myfname
Case Is = Null
MsgBox "Please enter a first name", vbCritical
End Select
Select Case myclinic
Case "1", "2", "3"
DoCmd.Save
DoCmd.Close
DoCmd.OpenForm "switchboard"
Case "0"
MsgBox "Please select a clinic", vbCritical
End Select
When I run this code I get the error
Run-time error '94'
Invalid use of null
The second select case works fine because the default value is 0
If anybody could help me and tell me where I am going worng that would be great
Thank
Marcus