Open form behavior

R

Rickety107

I have a form frmLookup that displays all of the programs. If the user click
the button next to that program it will open a new form frmEvent with all of
the program information. frmevent is opened using the following code
stDocName = "frmEvent"
stLinkCriteria = "[programid] = " & Me.ProgramID
stOpenArg = ""

DoCmd.OpenForm stDocName, , , stLinkCriteria, , , stOpenArg

frmLookup does not close.

frmEvent has alot of subfrms on it as well. There is code on the form_unload
event of some of these subforms. I have found out that some users are not
closing frmEvent before they load another program. With frmEvent still open
and displaying the information about programA they are bringing up the lookup
screen and choosing another program say ProgramB. Since frmEvent is already
open, when the docmd.openform is called to display the information of
programB, does Access realize the form is already open and just requery the
data for the new program or does it actually close the form and reopen it.

I need to know this to determine if the form_unload events are being called
in this scenario.
 
N

Naeem Azizian

I have a form frmLookup that displays all of the programs. If the user click
the button next to that program it will open a new form frmEvent with all of
the program information. frmevent is opened using the following code
stDocName = "frmEvent"
stLinkCriteria = "[programid] = " & Me.ProgramID
stOpenArg = ""

DoCmd.OpenForm stDocName, , , stLinkCriteria, , , stOpenArg

frmLookup does not close.

frmEvent has alot of subfrms on it as well. There is code on the form_unload
event of some of these subforms. I have found out that some users are not
closing frmEvent before they load another program. With frmEvent still open
and displaying the information about programA they are bringing up the lookup
screen and choosing another program say ProgramB. Since frmEvent is already
open, when the docmd.openform is called to display the information of
programB, does Access realize the form is already open and just requery the
data for the new program or does it actually close the form and reopen it.

I need to know this to determine if the form_unload events are being called
in this scenario.

It will not close the form, it will just remove the filter and then
filters it again for the new value. It however, "saves" the record,i
you want the events in the unload to happen, by refiltering the form,
it'd be more practical to put those in the afterupdate event of the
form.
 

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