Getting VB code to wait or pause

echorley

Registered User.
Local time
Today, 15:38
Joined
Mar 11, 2003
Messages
131
I have an OnClick event that has several inputs before the form adds a new record.

How do I get the code to wait for a text box selection until it moves on to the next line in the code?
 
Please provide us with more detail on what inputs are required before the record is saved, can you please post your code so far and where it is falling down.
 
Reply below

.
 
Last edited:
Here it is

Here is a bit of it. I click a command button called Kickoff. The form then instructs the user to select a kicker. I want the code to then wait until a kicker is selected from the text box. Then the code instructs the user to input where the ball was kicked to. I want to code to wait until that selection is made. Then, the form instructs the user to select a kick return person. Then wait again for that selection and finally, select the yardline returned to. As we all know, the code executes right through to the end.


Private Sub Kickoff_Click()

If Me.Possession = 1 Then
Me.Home_Roster.RowSource = "qryHomeRoster-Kicker"
Me.Opponent_Roster.Enabled = False
Me.Directions = "Select a kicker"

'Need code to wait here while the selection is made.

'Ask user for the yardline the ball was kicked to.
Me.Directions = "Yardlined kicked to?"

'Need code to wait here while the selection is made.

'Ask the user who is the kick returner and disable the Home roster.

Me.Opponent_Roster.RowSource = "qryOppRoster-KickRet"
Me.Opponent_Roster.Enabled = True
Me.Home_Roster.Enabled = False
Me.Directions = "Select kick return player"

'Need code to wait here while the selection is made.

Me.Directions = "Yardline returned to?"

DoCmd.GoToRecord , , acNext

'Enable the Home Roster
Me.Home_Roster.Enabled = True

Exit Sub
End If
 
pass the focus to each subsequent control in a daisy chain type sequence

ie button to pass focus to ?combo? selecting kicker where it waits for a selection. Use the on change event to pass the focus to the to kick off postion which waits for filling in. Again on change event to pass on to the next step.

you could disable/hide the other controls (turn them on and off) as the focus goes to each step to stop the user changing stuff outside of the chain of events you want.

or you could use a series of input boxes (or seperate small forms (replicate the "user forms" in excell) if you require drop down boxes that open and close, one for each step could do the same thing) to gather your variables back to your main form.

hth
Mike C
 

Users who are viewing this thread

Back
Top Bottom