Turning screenupdating off

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've got a form with a dropdown that a user can choose a date from. From this
VBA code runs through to get data for a pivot table I've built into a sub
form on this form. Problem is that to get the data for the sub form, I need
to open another form where I place the pivot table data and the screen then
changes to that form before moving back to my main form. I've tried
docmd.echo false
It doesn't work. Is there another way to stop the screen from moving from
the mainform, to the pivottable form being opened, closed, and then back to
mainform?

Hope this makes sense
 
I've got a form with a dropdown that a user can choose a date from. From this
VBA code runs through to get data for a pivot table I've built into a sub
form on this form. Problem is that to get the data for the sub form, I need
to open another form where I place the pivot table data and the screen then
changes to that form before moving back to my main form. I've tried
docmd.echo false
It doesn't work. Is there another way to stop the screen from moving from
the mainform, to the pivottable form being opened, closed, and then back to
mainform?

Hope this makes sense

Is there any possibility that the form your are opening is being
opened as "acDialog"? If so, that would explain why the focus is
being set to that form.

Otherwise, in my testing here, the following code run from a button on
"Form1" opens "Form2", makes sure all processing for opening the form
is completed and then closes "Form2" and sets the focus to a text box
control named "txtBox2" on "Form1", all without displaying the second
form at all.

DoCmd.Echo False
DoCmd.OpenForm "Form2"
DoEvents
Me.txtBox2.SetFocus
DoCmd.Close acForm, "Form2"
DoCmd.Echo True

HTH

Mr B
 
Back
Top