By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 1,027 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

Problem with AfterUpdate event

P: n/a
I'm developing an unbound form with a series of questions on it. Each
question is either a text box or an option group. I have coding in the
AfterUpdate event of each control to highlight the next question to be
answered, as a visual cue for the user. After the user has answered
all questions, they click on the "Save" button to save their answers.

My problem is that they have to click on "Save" twice because the
AfterUpdate event fires on the last control they input into. The next
question is highlighted then the user has to click on "Save" again.

Is there a way to get around this? Btw, I'm using 2003. Thanks in
advance for any help or advice.

Dec 6 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
That sounds like a really complicated way to design a form. Sounds like you
are providing controls for every question and every answer. If there's more
than 3 or 4 questions, this is going to be very time consuming to build, and
difficult to maintain.

You might like to look at this sample database by Duane Hookom. It
illustrates how to build a survey/questionaire type database:
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='At%20Your%20Survey%2 02000'

The answer to your immediate question will be to remove the code from the
AfterUpdate of the control, and use the Tab Order of the form (View menu) to
define where the focus goes to after that question.

Alternatively, if the survery jumps around lots, you could add a small
(nearly invisible) text box, and SetFocus to that when the last question is
done. In its Enter event, SetFocus to your Save command button. (This is
assuming you can't just SetFocus to the Save button from each of the exit
points.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"EManning" <ma**********@hotmail.comwrote in message
news:11**********************@f1g2000cwa.googlegro ups.com...
I'm developing an unbound form with a series of questions on it. Each
question is either a text box or an option group. I have coding in the
AfterUpdate event of each control to highlight the next question to be
answered, as a visual cue for the user. After the user has answered
all questions, they click on the "Save" button to save their answers.

My problem is that they have to click on "Save" twice because the
AfterUpdate event fires on the last control they input into. The next
question is highlighted then the user has to click on "Save" again.

Is there a way to get around this? Btw, I'm using 2003. Thanks in
advance for any help or advice.

Dec 7 '06 #2

P: n/a
Why not use code on the last AfterUpdate to check to see if it's being
fired by the button? I would think you can put a tag value on the
button and then check the value of the active tag, or something along
those lines.

EManning wrote:
I'm developing an unbound form with a series of questions on it. Each
question is either a text box or an option group. I have coding in the
AfterUpdate event of each control to highlight the next question to be
answered, as a visual cue for the user. After the user has answered
all questions, they click on the "Save" button to save their answers.

My problem is that they have to click on "Save" twice because the
AfterUpdate event fires on the last control they input into. The next
question is highlighted then the user has to click on "Save" again.

Is there a way to get around this? Btw, I'm using 2003. Thanks in
advance for any help or advice.
Dec 7 '06 #3

P: n/a
You're right about it being complicated. I considered Duane Hookom's
solution before I started this project. It wasn't visually-pleasing
enough for my customer however. There are about 20 questionnaires so
as long as they're willing to pay me for my time, then I'll give them
what they want.

Thanks for your reply.

Allen Browne wrote:
That sounds like a really complicated way to design a form. Sounds like you
are providing controls for every question and every answer. If there's more
than 3 or 4 questions, this is going to be very time consuming to build, and
difficult to maintain.

You might like to look at this sample database by Duane Hookom. It
illustrates how to build a survey/questionaire type database:
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='At%20Your%20Survey%2 02000'

The answer to your immediate question will be to remove the code from the
AfterUpdate of the control, and use the Tab Order of the form (View menu) to
define where the focus goes to after that question.

Alternatively, if the survery jumps around lots, you could add a small
(nearly invisible) text box, and SetFocus to that when the last question is
done. In its Enter event, SetFocus to your Save command button. (This is
assuming you can't just SetFocus to the Save button from each of the exit
points.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"EManning" <ma**********@hotmail.comwrote in message
news:11**********************@f1g2000cwa.googlegro ups.com...
I'm developing an unbound form with a series of questions on it. Each
question is either a text box or an option group. I have coding in the
AfterUpdate event of each control to highlight the next question to be
answered, as a visual cue for the user. After the user has answered
all questions, they click on the "Save" button to save their answers.

My problem is that they have to click on "Save" twice because the
AfterUpdate event fires on the last control they input into. The next
question is highlighted then the user has to click on "Save" again.

Is there a way to get around this? Btw, I'm using 2003. Thanks in
advance for any help or advice.
Dec 7 '06 #4

P: n/a
Thanks for your reply. I'll give this some more thought. I'm not sure
how to make this work right now. I would have to put this code in
every AfterUpdate event because not every question has to be answered
so there's no telling what the last AfterUpdate event would be.

ManningFan wrote:
Why not use code on the last AfterUpdate to check to see if it's being
fired by the button? I would think you can put a tag value on the
button and then check the value of the active tag, or something along
those lines.

EManning wrote:
I'm developing an unbound form with a series of questions on it. Each
question is either a text box or an option group. I have coding in the
AfterUpdate event of each control to highlight the next question to be
answered, as a visual cue for the user. After the user has answered
all questions, they click on the "Save" button to save their answers.

My problem is that they have to click on "Save" twice because the
AfterUpdate event fires on the last control they input into. The next
question is highlighted then the user has to click on "Save" again.

Is there a way to get around this? Btw, I'm using 2003. Thanks in
advance for any help or advice.
Dec 7 '06 #5

P: n/a

you might want to read this post...

http://groups.google.com/group/comp....b0a9d0315245c2

Dec 8 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.