Disable Button on Opening Form

A

Abe Katz

Hello All,

When I open a form I disable one of the buttons like this,
DoCmd.OpenForm "Ship List"
Forms![Ship ListDT]!ctlButton.Enabled = False

But it doesn't work when I open the form with acDialog option like this,
DoCmd.OpenForm "Ship List", , , , , acDialog

I know why, because the execution stops, when you open as a dialog form.

What can I do to disable the button even when opened as a dialog?
Thanks
Abe
 
C

Clifford Bass

Hi Abe,

Do the disabling inside the "Ship List" form's On Open event instead.

Clifford Bass
 
L

Linq Adams via AccessMonster.com

And if you do not always want the form to open with the button disabled, as
Clifford suggested, you can set a value in the form open command's OpenArgs
on Form1, then check OpenArgs on opening Form2, and set the button
conditionally.
 

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