How to position API dialog boxes within access container 
Author Message
 How to position API dialog boxes within access container

I've a feeling there's a better way, but what I've done is create a
small form named "frmFileDialog" with its PopUp property set to Yes
and AutoCenter set to No, and save it with its top left corner at the
location I want the API file dialog to appear.  Then to call the API
dialog, I first open frmFileDialog as a hidden form, and pass its hWnd
to the ahtCommonFileOpenSave function, using code like this:

    DoCmd.OpenForm "frmFileDialog", , , , , acHidden

    varFileName = ahtCommonFileOpenSave( _
                    OpenFile:=True, _
                    InitialDir:=strDirectory, _
                    Filter:=strFilter, _
                    Flags:=lngFlags, _
                    hWnd:=Forms!frmFileDialog.hWnd, _
                    DialogTitle:="Choose Payroll File(s) to Import")

    DoCmd.Close acForm, "frmFileDialog"

It's kludgy, but it works.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


Quote:
> I used the Access Web's code to call the windows
> OPEN/Save dialog box (Thanks!)
> [ http://www.*-*-*.com/ ]

> Is there a way to position the API dialog boxes within
> the Access Container?

> thanks

> Brentt



Sun, 15 May 2005 02:56:49 GMT  
 How to position API dialog boxes within access container
There's no other method without resorting to a callback sub for the API
File Dialog window. Personally, I like your method Dirk!
:-)
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Quote:
> I've a feeling there's a better way, but what I've done is create a
> small form named "frmFileDialog" with its PopUp property set to Yes
> and AutoCenter set to No, and save it with its top left corner at the
> location I want the API file dialog to appear.  Then to call the API
> dialog, I first open frmFileDialog as a hidden form, and pass its hWnd
> to the ahtCommonFileOpenSave function, using code like this:

>     DoCmd.OpenForm "frmFileDialog", , , , , acHidden

>     varFileName = ahtCommonFileOpenSave( _
>                     OpenFile:=True, _
>                     InitialDir:=strDirectory, _
>                     Filter:=strFilter, _
>                     Flags:=lngFlags, _
>                     hWnd:=Forms!frmFileDialog.hWnd, _
>                     DialogTitle:="Choose Payroll File(s) to Import")

>     DoCmd.Close acForm, "frmFileDialog"

> It's kludgy, but it works.

> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com

> (please reply to the newsgroup)



> > I used the Access Web's code to call the windows
> > OPEN/Save dialog box (Thanks!)
> > [http://www.mvps.org/access/api/api0001.htm]

> > Is there a way to position the API dialog boxes within
> > the Access Container?

> > thanks

> > Brentt



Sun, 15 May 2005 03:34:47 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Common dialog box methods fail within ACCESS.

2. position within text box

3. Positioning Common Dialog Box

4. How to position a common dialog box?

5. How to set the position of a dialog box

6. Common controls Dialog Box Positioning Of

7. Position common dialog box.

8. Common Dialog Box Positioning

9. Position Dialog Box ?

10. Position Common Dialog Box

11. Common Dialog Box - How to set position

 

 
Powered by phpBB® Forum Software