S
steve goodrich
I want to put a command button on my form that will perform the following
Go to a new record
Set the focus to my first field which is "Date From"
Display a message "Booking Confirmed"
I have typed in the following in the buttons on click event
DoCmd.GoToRecord , , acNewRec
Me.DATE_FROM.SetFocus
msgbox "Booking Confirmed"
One of my fields"Auth By" has a validation rule applied to it which is - IS
NOT NULL then the validation text message
If the validation rule is not broken then clicking the button carries out
the above code displaying my message and opening a new record with the
focus on my "Date From" field - which is what I want
If the validation rule is broken I.E there is no value in the "auth By"
field then I get the following error message
Run time error 2105
You can't go to the specified record
You may be at the end of a record set
How do I stop the error message. All I want to see is the Validation error
message so the user can complete the "Auth By" field
Any help would be appreciated
Steve
Go to a new record
Set the focus to my first field which is "Date From"
Display a message "Booking Confirmed"
I have typed in the following in the buttons on click event
DoCmd.GoToRecord , , acNewRec
Me.DATE_FROM.SetFocus
msgbox "Booking Confirmed"
One of my fields"Auth By" has a validation rule applied to it which is - IS
NOT NULL then the validation text message
If the validation rule is not broken then clicking the button carries out
the above code displaying my message and opening a new record with the
focus on my "Date From" field - which is what I want
If the validation rule is broken I.E there is no value in the "auth By"
field then I get the following error message
Run time error 2105
You can't go to the specified record
You may be at the end of a record set
How do I stop the error message. All I want to see is the Validation error
message so the user can complete the "Auth By" field
Any help would be appreciated
Steve