Current form takes too long to close

  • Thread starter Thread starter Ricoy-Chicago
  • Start date Start date
R

Ricoy-Chicago

I have a form [Welcome] where a user types the [Last Name], [First Name]
criteria (in textboxes), and he/she clicks on a command button to display the
records matching the criteria in the [Edit RecordMainForm] form. The Edit
form contains two subforms. The [Welcome] form does not close because of the
criteria needed.

Everything works fine but... the [EditRecordMainForm] form has a command
button to close it. When the user clicks on the command button, the
[EditRecord...] and [Welcome] forms are BOTH displayed for about 2-3 seconds,
then the [Welcome] form is maximized. This is the coding for the command
button on the [Edit...] form:

DoCmd.Close acForm, "EditRecordsMainForm", acSaveNo
stDocName = "Welcome"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Maximize

The [Welcome] form has an coding associated with the [On Activate] event.
The coding just clears the text boxes and setfocus.

Any help will be greatly appreciated.
 
See whether it makes a difference putting

DoEvents

after the DoCmd.Close statement.
 
Yes! it works... thanks

Douglas J. Steele said:
See whether it makes a difference putting

DoEvents

after the DoCmd.Close statement.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ricoy-Chicago said:
I have a form [Welcome] where a user types the [Last Name], [First Name]
criteria (in textboxes), and he/she clicks on a command button to display
the
records matching the criteria in the [Edit RecordMainForm] form. The Edit
form contains two subforms. The [Welcome] form does not close because of
the
criteria needed.

Everything works fine but... the [EditRecordMainForm] form has a command
button to close it. When the user clicks on the command button, the
[EditRecord...] and [Welcome] forms are BOTH displayed for about 2-3
seconds,
then the [Welcome] form is maximized. This is the coding for the command
button on the [Edit...] form:

DoCmd.Close acForm, "EditRecordsMainForm", acSaveNo
stDocName = "Welcome"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Maximize

The [Welcome] form has an coding associated with the [On Activate] event.
The coding just clears the text boxes and setfocus.

Any help will be greatly appreciated.
 
Back
Top