PopUp Property

gschimek

Registered User.
Local time
Today, 00:20
Joined
Oct 2, 2006
Messages
102
I want to attach some VBA code to a button that opens a form in PopUp mode, but I want the form's default PopUp property set to No. The reason is that I want to use the same form for entering data from 2 different areas of the database, and I want it to be a popup in one location, but not in another.

The reason is that I use the form to enter address information, and that information is then transferred to an envelope report once a "preview" button is clicked on the form. When I want the form in popup mode, the address information is auto-populated from another form, so no data entry is needed.

But I also want to be able to enter new addresses into the envelope entry form. But If I do this with the entry form in popup mode, the form stays in front of the envelope report when it is viewed. And if I close the entry form when the report is opened, I would have to re-enter the address information again if, say, I wanted to print a second envelope after closing the form.

Hopefully that makes sense.
 
OK, I think I've figured out that it may have something to do with the acDialog option to the openform command.

I tried opening the form with
Code:
DoCmd.OpenForm "frmEnvelopeEntryForm" , , , , , acDialog
and that opens it as a popup, since adding the acDialog option sets the popup and modal options to yes. But my VBA commands to populate the fields do not work. Then I getan error when the form is closed that says it can't find the form referred to in the VBA code. I'm assuming that's when it's trying to populate the form fields.

I think it's because the modal option is set to Yes. So is there a way to have the popup option set to yes, but the modal set to no?
 

Users who are viewing this thread

Back
Top Bottom