Stop code running

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

dbl

I have posted this before so please except my apologies for that, I though
we had sorted the problem by using a combo box, but it didn't take long
before we found it wasn't the complete answer.

It hasn't completely sorted the problem because the text is imported to the
db by monthly (updates) they are not always in the right format i.e. the
wording
is not always the same or could be misspelt. (We have no control over this
element of data input) 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 the word "Car" was imported. How do I stop the code
running with a message telling the operator that they must select the
correct type from the combo box?

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
 
Why not make CarCommercial a combo or list box with only the two choices and
limit the choices to the list? You give the user something also - they have
but to type a "p" or a "c" and get the appropriate type.
 
Upon rereading your post, I see you already have the combo. Just set the
Linit to list property to Yes.
Why not make CarCommercial a combo or list box with only the two choices and
limit the choices to the list? You give the user something also - they have
but to type a "p" or a "c" and get the appropriate type.
I have posted this before so please except my apologies for that, I though
we had sorted the problem by using a combo box, but it didn't take long
[quoted text clipped - 28 lines]
Thanks Bob
 
We have already set it limit to list but the field the combo box is bound to
can have any data in it.
jahoobob via AccessMonster.com said:
Upon rereading your post, I see you already have the combo. Just set the
Linit to list property to Yes.
Why not make CarCommercial a combo or list box with only the two choices
and
limit the choices to the list? You give the user something also - they
have
but to type a "p" or a "c" and get the appropriate type.
I have posted this before so please except my apologies for that, I
though
we had sorted the problem by using a combo box, but it didn't take long
[quoted text clipped - 28 lines]
Thanks Bob
 
Try this:

Select Case Me.CarCommercial
Case = "Private Car"
GoTo SkipMe
Case = "Commercial Veh\Van"
GoTo SkipMe
Case Else
MsgBox "You Cannot Proceed Without Entering Private Car or Commercial
Veh/Van"
Exit Sub
End Select
SkipMe:

I understand that Select Case is quicker than If... then and as you can see
it is a little cleaner.

We have already set it limit to list but the field the combo box is bound to
can have any data in it.
Upon rereading your post, I see you already have the combo. Just set the
Linit to list property to Yes.
[quoted text clipped - 11 lines]
 
AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 

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