Help: error message using GoToRecord vs the navigation buttons

  • Thread starter Thread starter Andrew Coyle
  • Start date Start date
A

Andrew Coyle

Hi

I have been using the navigation buttons on my form. If
there is incorrect data in any of the fields (eg missing
data for a primary key, or the required property was true
etc) then clicking the next record or new record
navigation buttons pops up a good long message explaining
the error
eg "the field xxx cannot contain a null value because the
required property for this field is set to true. Enter a
value into this field"

This is excellent, exactly what I want.

I have put a New Record button onto my form using the
wizard. The code is:
DoCmd.GoToRecord , , acNewRec
Now when it tries to go to a new record and there are data
problems it pops up the err.desc
"You can't go to the specified record"


I would much rather have the record navigation errors. Is
there any way to get the record navigation functionality
(or even just the errors) rather than the GoToRecord VB
one?

Thanks in advance
A
 
hi
you can do this, but you need to use code rather than a
macro.
It would be a better idea if you just fixed the data
first and then stopped people from creating new records
with invalid data.
 
Back
Top