andy_dyer
Registered User.
- Local time
- Today, 18:10
- Joined
- Jul 2, 2003
- Messages
- 806
Hi,
I don't know an awful lot about VBA but here's what I am trying to do...
I have two combo boxes NonStarter & Non_completer, they are both defaulted to "N/A".
I want it so that somone cannot have both boxes displaying anything other than "N/A".
So I have a statement that lists if one box says anything apart from N/A and so does the other box then display a message box telling them off and setting the focus back to the first box I want to them to check for an error...
My code is:
If Me.NonStarter = "No Response" Or Me.NonStarter = "Work Commitments" Or Me.NonStarter = "Illness/Further Tests" Or Me.NonStarter = "Now Wish To" Or Me.NonStarter = "Other" Or Me.NonStarter = "Cost" Or Me.NonStarter = "Transport" And Me.Non_completer = "No Response" Or Me.Non_completer = "Work Commitments" Or Me.Non_completer = "Illness/Further Tests" Or Me.Non_completer = "Now Wish To" Or Me.Non_completer = "Other" Or Me.Non_completer = "Cost" Or Me.Non_completer = "Transport" Then
MsgBox "The Client Cannot Be Both a Non-Starter & a Non-Completer. Please now set the Non-Completer Reason first and then set the Non-Starter Reason."
Cancel = True
Me.Non_completer.SetFocus
Exit Sub
End If
Can anyone tell me what I am doing wrong?
Thanks
Andy
I don't know an awful lot about VBA but here's what I am trying to do...
I have two combo boxes NonStarter & Non_completer, they are both defaulted to "N/A".
I want it so that somone cannot have both boxes displaying anything other than "N/A".
So I have a statement that lists if one box says anything apart from N/A and so does the other box then display a message box telling them off and setting the focus back to the first box I want to them to check for an error...
My code is:
If Me.NonStarter = "No Response" Or Me.NonStarter = "Work Commitments" Or Me.NonStarter = "Illness/Further Tests" Or Me.NonStarter = "Now Wish To" Or Me.NonStarter = "Other" Or Me.NonStarter = "Cost" Or Me.NonStarter = "Transport" And Me.Non_completer = "No Response" Or Me.Non_completer = "Work Commitments" Or Me.Non_completer = "Illness/Further Tests" Or Me.Non_completer = "Now Wish To" Or Me.Non_completer = "Other" Or Me.Non_completer = "Cost" Or Me.Non_completer = "Transport" Then
MsgBox "The Client Cannot Be Both a Non-Starter & a Non-Completer. Please now set the Non-Completer Reason first and then set the Non-Starter Reason."
Cancel = True
Me.Non_completer.SetFocus
Exit Sub
End If
Can anyone tell me what I am doing wrong?
Thanks
Andy