Checking field for a value

mattP

Registered User.
Local time
Today, 23:12
Joined
Jun 21, 2004
Messages
87
I've had a search in the threaqds for an answer but cannot find anything specific, plus this one has stumped me.

What I need to do is check if a certain field has a value if another field has a specific value ??!!?

Ok so if Combo Box 1 is set to 1, then Combo box 2 must have a value selected.
If ComboBox 1 is set to 2, then Combo Box 3 must have a value.

for any other value for ComboBox 1 box 2 & 3 do not require a value.

If either of these statements are not correct then a message box should come up

Any help would be greatly appreciated

MattP
 
I'll have a go and see how it goes, thanks for the suggestion

MattP
 
Ok so I've got the following code behind my close form button

Select Case me.root (field which sets my crieria)

Case 1
If Me.Office = "" Then
MsgBox "Please select an Office location", VbOkOnly
Else
Docmd.close
Case 2
DoCmd.Close
Case 3
DoCmd.Close
Case 4
If me.service - "" Then
MsgBox "please select a service provider", VbOkOnly
Else
DoCmd.Close

End Select


When I click the close button it errors, highlighting the 2nd case, stating
"Case without Select Case"

Any pointers ?

Thanks

MattP
 
Ok so I've got the following code behind my close form button

Select Case me.root (field which sets my crieria)

Case 1
If Me.Office = "" Then
MsgBox "Please select an Office location", VbOkOnly
Else
Docmd.close
Case 2
DoCmd.Close
Case 3
DoCmd.Close
Case 4
If me.service - "" Then
MsgBox "please select a service provider", VbOkOnly
Else
DoCmd.Close

End Select


When I click the close button it errors, highlighting the 2nd case, stating
"Case without Select Case"

Any pointers ?

Thanks

MattP
 
Use a

Code:
Case Else

at the end for anything not mentioned in the other cases.
 

Users who are viewing this thread

Back
Top Bottom