Open a form as acDialog

TedMartin

Registered User.
Local time
Today, 15:24
Joined
Sep 29, 2003
Messages
76
I have a main form that opens another in acDialog mode in order to get two input pieces of data for use in a subsequent Action query.

In order to keep these two pieces of data availble rather than closing the "acDialog" form, I have a button to hide it [ me.visible = false ]

However, when the OK button is pressed on the acDialog form, nothing happens but when you press it it a second time, the rest of the code from the initial form runs and so does my Action query. End result purrfect BUT ...

Why do I have to press the button on the acDialog form twice in order for the main form's code to continue? Its bugging me. Thanks
 
Because that form does not have the focus. Your first click is setting the focus to the form and the second click is actually hitting the ok button.

I suggest that you store the data in a table to be retrieved when needed. Or use a global string. Some warn of the use of global strings but I have never had a problem for when I need to use them.
 
Thanks - just checked - you are absolutely right. If I tab from the final text box to the OK button the focus is set and the OK button works with one click. If I use the mouse to progress - it requires 2 clicks.
 

Users who are viewing this thread

Back
Top Bottom