trivia question on Form

D

DiDi

I am currently design a Form, use "on open" event property of the FORM
to make a selection. However, I keep getting the message before the
FORM open, even I put "timeinterval =500", it does not help. Any one
know how to do so FORM pop up first then the message displays
afterwards. Thanks.

Private Sub Form_Open(Cancel As Integer)
Dim bolyn As Integer

DoCmd.SetWarnings False

Me.Comdis.Enabled = False
Me.Comdoc.Enabled = False
timeinterval = 500
bolyn = MsgBox("Sorted by PlantInvent?", vbYesNo + vbDefaultButton1,
"Sorting")

Select Case bolyn
Case vbNo:

Me.Comdis.Enabled = True
Me.Comdis.SetFocus


Case vbYes:
Me.Comdoc.Enabled = True
Me.Comdoc.SetFocus

End Select
End Sub
 
D

DiDi

Before I posted the topic, I did try events of On Current, On Load
got the same result , I did try "before update" and "after render",
nothing came out different. it got be something simple, just don't
know. Anyone out there knows the tricks???
 
R

Rick Brandt

DiDi said:
Before I posted the topic, I did try events of On Current, On Load
got the same result , I did try "before update" and "after render",
nothing came out different. it got be something simple, just don't
know. Anyone out there knows the tricks???

TimerInterval only affects the OnTimer event, not any other (like Open). Put
your code in the Timer event and add a line at the end to set the TimerInteval
to zero so it doesn't keep running over and over. You might also be able to
stay with the Open event if you add...

Me.Visible = True

....as the first line of code.
 
D

DiDi

Thank you so much, On Open event and add one line you suggested, it
works great!!!
 

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