M
Matt Jaffey
I have a question about hiding dialog boxes in Access 2000. I am
working on an application in which there is a form that is maximized
on the screen. On this form, there is a button which brings up a
dialog box on which some data entry can be done. The records that come
up in the dialog box are based on information found on the form behind
it.
For some reason, the dialog box opens very slowly (unacceptably
slowly) in some circumstances. I'm looking for ways to speed this up.
I'd be interested in any suggestions about this, but my question has
to do with one specific approach that I've tried:
Originally, the Close button on the dialog box closed the form. I've
been trying instead to simply hide the form by setting its visible
property to false. Then, the next time someone clicks on the button on
the main form, the DoCmd.OpenForm command opens the dialog box without
delay. There are a couple of problems though:
a) When the dialog box is hidden, it doesn't cause any events to take
place, so if the user was in the middle of editing a record in the
dialog box, hiding it doesn't cause the record to save. This is a
problem because the main form needs to do a requery that will show
changes made in the dialog box.
b) When the dialog box is made visible again, it doesn't cause any
events to take place. Suppose that after closing (hiding) the dialog
box, the user changes to another set of data on the main form, and
then returns to the dialog box - the data displaying in the dialog box
needs to change to correspond to the new data set on the main form. A
simple requery within the dialog box would do this, but since no
events take place, I haven't found a place to put the requery.
These problems don't occur if I don't use the modal and popup settings
and don't use "acDialog" as the window mode in the DoCmd.OpenForm
command. However, the modal and popup features are important to this
application. Also, it is important that the code in the on click event
for the button that opens the dialog box be suspended while the dialog
box is open (or visible). So it looks like I need to open this form as
a dialog box.
Does anyone have any ideas about this?
Thanks,
Matt
working on an application in which there is a form that is maximized
on the screen. On this form, there is a button which brings up a
dialog box on which some data entry can be done. The records that come
up in the dialog box are based on information found on the form behind
it.
For some reason, the dialog box opens very slowly (unacceptably
slowly) in some circumstances. I'm looking for ways to speed this up.
I'd be interested in any suggestions about this, but my question has
to do with one specific approach that I've tried:
Originally, the Close button on the dialog box closed the form. I've
been trying instead to simply hide the form by setting its visible
property to false. Then, the next time someone clicks on the button on
the main form, the DoCmd.OpenForm command opens the dialog box without
delay. There are a couple of problems though:
a) When the dialog box is hidden, it doesn't cause any events to take
place, so if the user was in the middle of editing a record in the
dialog box, hiding it doesn't cause the record to save. This is a
problem because the main form needs to do a requery that will show
changes made in the dialog box.
b) When the dialog box is made visible again, it doesn't cause any
events to take place. Suppose that after closing (hiding) the dialog
box, the user changes to another set of data on the main form, and
then returns to the dialog box - the data displaying in the dialog box
needs to change to correspond to the new data set on the main form. A
simple requery within the dialog box would do this, but since no
events take place, I haven't found a place to put the requery.
These problems don't occur if I don't use the modal and popup settings
and don't use "acDialog" as the window mode in the DoCmd.OpenForm
command. However, the modal and popup features are important to this
application. Also, it is important that the code in the on click event
for the button that opens the dialog box be suspended while the dialog
box is open (or visible). So it looks like I need to open this form as
a dialog box.
Does anyone have any ideas about this?
Thanks,
Matt