Clear form value after report loads

  • Thread starter Thread starter Jake F
  • Start date Start date
J

Jake F

I have a report w/ sub report based on the same query. I use a combo box and
filter based on the value selected in the combo box. Here is my coding for
it. The problem is that the value is cleared before the subreport can load.
Is there a way to tell it to load the subreport and then clear the box or do
I need to put the clear somewhere else? Thanks.

Private Sub Combo13_AfterUpdate()
DoCmd.Hourglass (hourglassOn)
DoCmd.OpenReport "rptScoreStats", acViewPreview
Me!Combo13.Value = Null
DoCmd.Hourglass (Hourglassoff)
End Sub
 
Add a delay in your code to give the report time to load:

http://www.datastrat.com/Code/Delay.txt

so your code would now look like:

Private Sub Combo13_AfterUpdate()
DoCmd.Hourglass (hourglassOn)
DoCmd.OpenReport "rptScoreStats", acViewPreview

Delay (3) ' 3 second delay

Me!Combo13.Value = Null
DoCmd.Hourglass (Hourglassoff)
End Sub
 
Back
Top