473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Problem with AfterUpdate event

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
5 3929
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
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
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
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

you might want to read this post...

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

Dec 8 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris Thompson | last post by:
I am using Access 97 (if this makes any difference to any answers). On a form I have a combobox and I want it such that when a user selects an item from the list, this executes an 'INSERT INTO'...
3
by: jdph40 | last post by:
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...
2
by: jv | last post by:
Hello, I have a Service Cancellation form that contain a CancelDate text box. The text box has an AfterUpdate event that perform a few calculations. This works fine. However, next to the text...
1
by: Cong | last post by:
Hi I have two unbounded text boxes (startdate and enddate). If I entered the date manually I can can set validation for the text box for example < date() this will works but if I have a...
10
by: Parasyke | last post by:
I have a form that I choose from a list of database names and a list within a textbox comes up with the computer ID number and an associated (from a table) user name. Is there a way from looking at...
3
by: Jim Devenish | last post by:
In my application vehicles arrive and depart from a workshop. The ArrivalDate and the HandoverDate are each entered. Sometimes the person who should enter the arrival date forgets to do so. ...
4
by: bcallnan | last post by:
Hello All- I am trying to reference a subform's afterupdate event that is 3 deep and am having some trouble getting it to work. The control is a combo box and i cannot seem to trigger the...
2
by: Neil | last post by:
I'm using Access 2000 with a SQL 7 back end. I recently implemented some code in a form's AfterUpdate event which calls a stored procedure which copies the contents of the current record to a...
12
by: Gerhard | last post by:
This is bizarre... Im having problems with the combobox AfterUpdate event: Im running Access 2003. I created an unbound combobox with 3 columns on a form. The Row Source is from a table....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.