Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cancel Current Enter

Status
Not open for further replies.

MikeMcKeown

Programmer
Apr 1, 2003
69
GB
I have tried this question on another forum and it was suggested I try this forum so sorry for anyone reading this twice.

I have a form when I try to enter a null primary key I get runtime error 515. I have trapped this error in the OnError() event of the form. Which works fine. However this error is not being captured at all points on the form.

i have a combo box on my form which displays the correct record depending on what the user has entered. i still get the error message when the user:-

Is in the middle of entering a record - does not enter a PK and then tries to go to the look up box and find a new practice. I have tried to put code in the OnUpdate() and the OnFocus() events of the lookup box.

Is there anyway of cancelling the current record if it is not complete before the user moves to another control. So the user would get a message saying:-

The record is not complete. click Ok to complete changes or no to continue and not save changes.

Thanks is advance.
 
Take a look at the BeforeInsert event.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Why not disable the combo or hide it until the record is complete??
Another way would be to check the validity of the record when the combo gets the focus.

Frank J Hill
FHS Services Ltd.
frank@fhsservices.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top