back2basic
Registered User.
- Local time
- Today, 12:21
- Joined
- Feb 19, 2013
- Messages
- 113
This one is a bit difficult for me to figure and understand how to solve. Please keep in mind, I am doing all I describe below in effort to handle an "escape" by the user. If the user "escapes" I want to clear the form and close it which I can do fine with the error handler and the following code. The problem is I can't handle the weird stuff the Combo Box does?
What is happening: I have an unbound Combo Box which the information is used to populate unbound fields on a form ( for user information only). The Combo Box triggers an event code I have tried this both ways with the following results:
BeforeUpdate - This makes it very easy to handle the escape as no data is written to the table but after the user selects a record in the Combo Box the code runs twice? Once after the user selects the information in the CB and then again when the user hits enter. It seems the forms does not advance to the next field after the CB data selection?
AfterUpdate - This makes it very hard to handle the data entry after the CB because I automatically move to the next field but no matter what I do, a record gets created ( even though except for the date it is blank)
What is the best way to do this and stop the non-sense I must be creating?
Thank you all in advance.
Code:
Handler:
DoCmd.CancelEvent
DoCmd.Close
BeforeUpdate - This makes it very easy to handle the escape as no data is written to the table but after the user selects a record in the Combo Box the code runs twice? Once after the user selects the information in the CB and then again when the user hits enter. It seems the forms does not advance to the next field after the CB data selection?
AfterUpdate - This makes it very hard to handle the data entry after the CB because I automatically move to the next field but no matter what I do, a record gets created ( even though except for the date it is blank)
What is the best way to do this and stop the non-sense I must be creating?
Thank you all in advance.