acDialog not letting me access menus

J

James

I have a main form (frmGetCustomer) that opens another form (frmCustomer) to
a specific record. I am using acDialog because I want the code to pause
because the next line is a requery for the main form. So if there is any
changes the main form will be updated. However, when I am using acDialog the
form acts like it is modal and popup. I open frmCustomer from many different
forms. Is there a way to have frmCustomer requery any form that it is opened
from? like: forms.parent.requery
 
K

Ken Snell [MVP]

Pass the name of the form to be requeried in the OpenArgs string when you
open frmCustomer:

DoCmd.OpenForm "frmCustomer", , , , , acDialog, "NameOfFormToRequery"


Then use Me.OpenArgs in the frmCustomer form to do the requery:
Forms(Me.OpenArgs).Requery
 
A

Albert D. Kallal

You can just use the forms Activate event.

The form then can call any other form (make those other forms model..not
acDialog). When the user closes the form, the calling forms on-activate
event will fire. So, you don't need any code in the frmGetCustomer.
Is there a way to have frmCustomer requery any form that it is opened
from? like: forms.parent.requery

Hum...the above is the reversing of your original question..is it not?

You can most certainly pick up the calling form. In fact, you would
normally use the on-open event..but you can even pick up the previous forms
name as LATE as the on-load event.

So, just declare a local module level var for frmCustomer

dim frmPrevous as form

Now, in the on-load event, we go:

set frmPrevious = screen.ActiveForm

Now, anywhere in your forms code, you can go:

frmPrevous.Refresh (force a disk write in the previous form)

or

frmPrevous.Requery (force a requery in the previous form)

or

msgbox "number of records in previous form is " &
frmPrevous.RecordSetClone.RecordCount
 
J

James

First, thank you for your help. You have acDialog, but I cannot use that
because when they open a report (to view) from frmCustomer access will not
let you print the report. Am I doing something wrong with the report because
I cannot get to the menu bar to print? The report has the focus and seems to
be modal, but both modal and popup are set to no in the reports properties.
 

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