i have to press escape when i open a form

simon_marklar

Registered User.
Local time
Today, 12:14
Joined
Apr 6, 2005
Messages
19
can anyoen tell me why it is when i open a form, the first thing i have to do is press "Escape" ???

eg. i have a form with a list box of items. when an item in the list box is clicked I load the data for the item into the fields on the form. when the form is opened (from a menu, with edit mode specified)the form is blank and no item is selected in teh list box, but its in edit mode (the pencil is in the side bar). if i click on items from the list box, nothing happens - the click even does not fire. the only way to make the form work is by pressing 'esc' then clicking on an item in the listbox.

this database was created in access 2000 and i just updated to 2007, which is when the problem started happening. i've tried setting the list box to an item in the programming, which does nothing. then i tired firing the list_click event. that did nothing. I've also tried specifiying "acAdd" or "acEdit" in the openform call. no dice.

there's gotta be something simple i have missed. anyone have any clues?

thanks!
 
It sounds as if you have code that's moving to a New Record on the form's opening. Pressing <Esc> undoes the New Record, allowing you to then click on the listbox.
 
It would be tough to say what could be causing something like this especially without looking at the Database. I personally have never encountered this. I find, most often when something goes stupidly wrong, the Form crashes and becomes corrupt and is usually non-recoverable and it's almost always initiated by playing with (modifying and testing) the underlying code within the code module of that very Form.

In your case, you need to hit the Escape key to continue on which basically tells me that it's really nothing to serious but for some reason I get the feeling it's from code within the Forms' OnOpen, OnLoad, or even OnCurrent events. It's as though a message is sent but not displayed and by hitting the Escape key you are in fact sending acknowledgment of that message.

I would first try to go into the VBA IDE and do a Compile. See if that will pin-point something. Ensure that Option Explicit is in fact located at the top of the Forms' Code Module before you do so.

If that doesn't find anything then perhaps start working with each of the controls within the Form. Removing one at a time and replacing them. Test the Form after each change so as to try and pin-point the problem.

You may very well need to reconstruct the Form completely.

Like I said, I have never come across such a thing but it doesn't surprise me either.

.
 

Users who are viewing this thread

Back
Top Bottom