Code for text that doesn't match that required

  • Thread starter Thread starter dbl
  • Start date Start date
D

dbl

Hi I am stuck with the following, how do I get my code to give the message
in the MsgBox if the data in field CarComercial is null or has any value
other than Private Car or Commercial Veh/Van

If (Me.Insurer) = "AAC" Or (Me.CarCommercial) = "Private Car" Or
(Me.CarCommercial) = "Commercial Veh/Van" Then

GoTo SkipMe
Else

If (Me.CarCommercial) = !!! Help needed here !!! Any text other than above
or null !!!! Then
MsgBox "You Cannot Proceed Without Entering Private Car or Commercial
Veh/Van"
Me.InvoiceVatTo = "Error Insufficient Data You Must Not Proceed"


Exit Sub

SkipMe:

Thanks Bob
 
Hi I am stuck with the following, how do I get my code to give the message
in the MsgBox if the data in field CarComercial is null or has any value
other than Private Car or Commercial Veh/Van

Rather than making the user type in all this text and punishing them
if they make an error, why not simply use a Combo Box with a List of
Values row source containing these two options?

John W. Vinson[MVP]
 
John that's a case of not being able to see the wood for the trees.
The combo box has sorted the problem.

Thanks for your help.
Bob
 
John it hasn't completely sorted the problem the text is imported to the db
monthly (updates) they are not always in the right format i.e. the wording
is not always the same. How do I stop code running if the words are
different from that required i.e. Private Car or Commercial Veh/Van. The
combo stops us from changing the text to any other than that required, but
the code still runs if Car was imported.

Thanks Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top