Dialog form and file requestor

daveinhull

Registered User.
Local time
Today, 03:56
Joined
Mar 4, 2014
Messages
22
Hi,

Hope someone can help.

I have a main form which is opened from AutoExec after doing some pre-processing. The main form is opened using the dialog option so that I can close the background Access window, thus making the form look like an independent application window. All this works fine.

However, on the form is a button which brings up the standard Microsoft file requestor, but when the file requestor is active I can hit the form button again and another file requestor pops up. The code on the form is waiting for the file requestor to return from the first requestor. When I close the file requestor it continues, but then when I close the second file requestor it continues again - as if there are two threads running.

If the main form is opened in normal mode this doesn't happen.

What I want to do is to be able to open the standard Microsoft file requestor in modal mode. I have worked around it by disabling the button on the first press until the requestor returns but other effects exist like loosing the file requestor if the main form is selected etc.

I'm using the apiGetOpenFileName api function.

Anybody got any thoughts?

Many thanks
Dave
 
daveinhull, sorry to sound ignorant, but what is file requestor?
 
Hi,

Basically the use of the api function (apiGetOpenFileName) which opens up a form to let the use select a filename, e.g. open file, save file etc.

Like in Word when you want to open a file it brings up a file selector window.

Dave
 
Hi All,

Ok I found the fix. The Hwnd (parent window handler) was set to Null so I changed it to the handler for the form window and now it works.

Thanks
Dave
 

Users who are viewing this thread

Back
Top Bottom