Clears form data but not ID on 'Not in list' cbo

A

anil

Hi all
I am using form to add data with fields -
PermitID,PermitNo,Date,CustomerID,Details...

In this form CustomerID is in the combobox (CustomerID is linked to
ServiceID and hence ServiceNo is displayed in Combobox)and user is
allowed to select from the list.

Due to some errors there are some service no's which need new
CustomerID or customer is replaced or customer is edited., which admin
had the authorisation to change the details.

So what I want is that if the service no is not in list user gets the
message "Data is not in list,Please contact admin"(this I have done).

Now I want to clear the form so that they can try other service no's
and leave the wrong serviceNo aside and ring admin at the end of day.

But as soon as I enter the PermitNo and date, PermitID is assigned.If
I use Me.Undo then that record is deleted and I missed that PermitID.
If I do Me.CustomerID=Null Then it gives message that "You tried to
assign Null value to variable that is not variant"

Is there any method that CustomerID is cleared ,user gets message and
also the record is on same PermitID.

Thanks
Anil
 
M

Michel Walsh

Instead of Me.Undo, try Me.ControlName.Undo. The first expression clears
the form, the second, only the control.


Hoping it may help,
Vanderghast, Access MVP
 

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

Top