Open "Dialog" Form Relative to Control

  • Thread starter Tom via AccessMonster.com
  • Start date
T

Tom via AccessMonster.com

I would like to use Stephen Leban's A97OpenFormRelativeControl to open a
Dialog Form.

I changed the following line in modPositionWindow from:

DoCmd.OpenForm frmName

to:

DoCmd.OpenForm frmName, , , , , acDialog

The form acts like a Dialog form but it does not open the form relative to
any control.

It seems the next line in the code:

Set frm = Forms.Item(frmName)

results in frm = Nothing.

Any help is appreciated.

Tom
 
D

Dirk Goldgar

Tom via AccessMonster.com said:
I would like to use Stephen Leban's A97OpenFormRelativeControl to
open a Dialog Form.

I changed the following line in modPositionWindow from:

DoCmd.OpenForm frmName

to:

DoCmd.OpenForm frmName, , , , , acDialog

The form acts like a Dialog form but it does not open the form
relative to any control.

It seems the next line in the code:

Set frm = Forms.Item(frmName)

results in frm = Nothing.

Any help is appreciated.

I'm not familiar with that code, but if you open the form in dialog
mode, the next line in the calling form's code won't be executed until
the dialog form is closed or hidden. So that would be why frm is
Nothing at that point.

I believe you're going to have to move the relevant code into the dialog
form itself (probably its Open event), appropriately modified so that
the form positions itself relative to the control on the calling form.
If the dialog form may be opened from multiple modules, you'll probably
need to pass the form and control names via OpenArgs.
 
T

Tom via AccessMonster.com

Dirk said:
I would like to use Stephen Leban's A97OpenFormRelativeControl to
open a Dialog Form.
[quoted text clipped - 17 lines]
Any help is appreciated.

I'm not familiar with that code, but if you open the form in dialog
mode, the next line in the calling form's code won't be executed until
the dialog form is closed or hidden. So that would be why frm is
Nothing at that point.

I believe you're going to have to move the relevant code into the dialog
form itself (probably its Open event), appropriately modified so that
the form positions itself relative to the control on the calling form.
If the dialog form may be opened from multiple modules, you'll probably
need to pass the form and control names via OpenArgs.


Thanks for the info!

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top