473,656 Members | 2,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3942
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.rogersacces slibrary.com/Otherdownload.a sp?SampleName=' At%20Your%20Sur vey%202000'

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**********@h otmail.comwrote in message
news:11******** **************@ f1g2000cwa.goog legroups.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.rogersacces slibrary.com/Otherdownload.a sp?SampleName=' At%20Your%20Sur vey%202000'

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**********@h otmail.comwrote in message
news:11******** **************@ f1g2000cwa.goog legroups.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
1698
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' action query to be executed that adds the item and time and date into a table. This works fine as an afterupdate event of the combobox EXCEPT for the very first time a selection is made in the combobox (ie the contents of that bound control go from...
3
2915
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 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...
2
1941
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 box is a calendar button that would allow users to select a date using a pop calendar form. This calendar form works great except that I want the textbox's afterupdate event to run after a date has been selected using the popup form. So what did...
1
2218
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 calendar control populating the date automaticcaly. It will bypass the validation. I try this for validation but does not
10
3088
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 this code to tell the network ID name? I hope not to have to write the code with the "Dev Ashish" API code, which I'm sure is great but I can't figure out how to implement it in a form like mine. Please look at the below code and tell if I can...
3
6672
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. When the vehicle is handed over to the customer and the HandoverDate is entered I wish to warn about the possibly missing ArrivalDate. In the BeforeUpdate event of HandoverDate I have: Private Sub HandoverDate_BeforeUpdate(Cancel As Integer) If...
4
4697
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 afterupdate event from another subform. The control is on Mainform.Subform1.Subform1.cbocontrol.afterupdate. I am able to plug in a value, but i need to have the event called in order to populate the form. I am trying to refernce it with the following...
2
1585
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 history table. The code works fine when the user edits and saves the record. However, if the user performs a Find and Replace, the code hangs. At first I thought the code was hanging because of multiple records being replaced. But when I debugged...
12
5445
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. Bound Column = 1 and LimitToList = No,,, thus the user can edit the data in the 1st-Column after they selected one of the rows in the combobox. However, I want to save the data of 2nd-Column and 3rd-Column, because if the user edits the 1st-column,...
0
8296
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8598
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7310
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4299
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1598
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.