jd****@yahoo.com (jd****@yahoo.com) wrote in message news:<75**************************@posting.google. com>...
In Access 2002, I designed a simple database for our Safety department
to enter results of a survey. There are 41 true/false statements. I
have a main form called frmSurvey with a subform called sbfrmAnswers.
I put an option group (optAnswers) on the subform with buttons for
true or false. To speed entry of the results of the 350+ surveys
we've collected, I put the following code in the AfterUpdate event of
the option group:
With DoCmd
.GoToControl "txtEmpty" 'a text box on frmSurvey that looks invisible
.GoToRecord,,acNext
.GoToControl "sbfrmAnswers"
.GoToControl "optAnswers"
End With
This works perfectly and you can enter the results of a survey in no
time, but it goes so fast the data entry clerk can't see that she
clicked the correct button. Is there any way to pause the execution
of the code above after the focus gets to txtEmpty so she can look at
optAnswers and verify that she clicked the correct button?
Yes. Create a second form (frmOptionSelected) with a label control on
it (lblSelected). In the load event of frmOptionSelected put the line
lblSelected.Caption = "You selected option " &
forms!frmSurvey!optAnswers
In the Timer event of frmOptionSelected put the line
DoCmd.Close
Set the Timer Interval property of frmOptionSelected to 1000. Now, on
frmSurvey change the optAnswer AfterUpdate code to
With DoCmd
.OpenForm "frmOptionSelected", , , , , acDialog ' pause, display sel.
option
.GoToControl "txtEmpty" 'a text box on frmSurvey that looks invisible
.GoToRecord,,acNext
.GoToControl "sbfrmAnswers"
.GoToControl "optAnswers"
End With
This will open a form which will display the option that the user
selected and will pause the execution of your optAnswer AfterUpdate
code. It will stay on the screen for one second and then close
automatically allowing your optAnswer AfterUpdate code to continue.
If you want it to pause for shorter or longer periods of time, modify
frmOptionSelected's Timer interval property. You'll probably also
want to make some cosmetic changes to frmOptionSelected to get rid of
the control box, record selectors, navigation bar, caption bar, etc.
HTH,
Bruce