
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