> You are correct....the customer ID is text.
> The code change I made marries to yours exactly.
[quoted text clipped - 77 lines]
> > > > > Any ideas or places where I could look at how this should be handled?
> > > > > Thanks in anticipation.
Hi
Have done that.
Get an Access message telling me that the Close action was cancelled.
I can't close the form.
Funnily enough, if I click on the Add Customer button, all fields are
blanked as you would expect and if I press the Close button then the Form
closes. If I check the Customer table it is ok, there isn't an empty record.
However, if I click on the Add Customer button, type in a duplicate code,
get the error message about duplicates, highlight the customer code that I
entered, press Del followed by Close then when I check the Customer table it
now contains a blank record?
What is the difference between the two?
> HHHHHHMMMMMMMMMM
> I think I understand the problem. The only other thing I can think of would
[quoted text clipped - 84 lines]
> > > > > > Any ideas or places where I could look at how this should be handled?
> > > > > > Thanks in anticipation.
Klatuu - 12 Oct 2005 13:02 GMT
The difference is that in the first case, the form is not dirty, but in the
second case, you have entered data, and the form is dirty. Try adding the
Me.Undo below. I think that should cure the problem.
If Me.Dirty And IsNull(Me.Company_ID) Then
Cancel = True
Me.Undo
End If
> Hi
> Have done that.
[quoted text clipped - 97 lines]
> > > > > > > Any ideas or places where I could look at how this should be handled?
> > > > > > > Thanks in anticipation.