473,509 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form Does Not Go To New Record

I have a form with about 30 fields. Much of data entry for this form involves
the same data for many of the fields. To save typing time, in the form's
AfterUpdate event I run a procedure that sets the defaultvalue property of each
field to the value of that field in the last saved record. Essentially what
happens is when a record is saved it becomes the default new record in the form.
I have some comboboxes on the form that draw their data from tables that have
only one field. When I make a selection in any of these comboboxes for the
current record and then click on the new record button in the navigation
buttons, the AfterUpdate event runs fine and the default values are set.
However, the form does not go to the new record. I have to click on the new
record button a second time to move the form to the new record. When the form
moves to the new record, the default values are what they should be. I know the
procedure to change the default values runs the first time a click the new
record button because I put a MsgBox in the procedure and it pops up.

Does anyone have any ideas why the form does not go to a new record the first
time I click the new record button and does anyone have any ideas why this
behaviour occurs when values are changed in the comboboxes?

Thanks!

Steve
Nov 12 '05 #1
1 2468
Just a suggestion, Steve

Double-check your code to see if you missed the ".DefaultValue" bit for any
of the combos. If you actually assigned a value to the combo instead of
assigining its DefaultValue property, you would be dirtying the form again
in its AfterUpdate event, and that would stop it from moving to the new
record.

--
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.

"Steve" <sp**@nospam.spam> wrote in message
news:OX*****************@newsread3.news.atl.earthl ink.net...
I have a form with about 30 fields. Much of data entry for this form involves the same data for many of the fields. To save typing time, in the form's
AfterUpdate event I run a procedure that sets the defaultvalue property of each field to the value of that field in the last saved record. Essentially what happens is when a record is saved it becomes the default new record in the form. I have some comboboxes on the form that draw their data from tables that have only one field. When I make a selection in any of these comboboxes for the
current record and then click on the new record button in the navigation
buttons, the AfterUpdate event runs fine and the default values are set.
However, the form does not go to the new record. I have to click on the new record button a second time to move the form to the new record. When the form moves to the new record, the default values are what they should be. I know the procedure to change the default values runs the first time a click the new
record button because I put a MsgBox in the procedure and it pops up.

Does anyone have any ideas why the form does not go to a new record the first time I click the new record button and does anyone have any ideas why this
behaviour occurs when values are changed in the comboboxes?

Nov 12 '05 #2

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

Similar topics

1
7830
by: Robert Neville | last post by:
I would like to add filter functionality to my database whether through the Main form or the subform. This question may be rudimentary, yet I have not less experience with filtering data outside...
4
4726
by: Skully Matjas | last post by:
I am using the following code (created by the wizard) to allow to bring my form to a particular entery. But when I edit the entery (ex: put new information into a blank cell), it puts that record...
15
4643
by: Steve | last post by:
I have a form with about 25 fields. In the BeforeUpdate event of the form, I have code that sets the default value of each field to its current value. For a new record, I can put the focus in any...
25
10167
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
8
12066
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
22
4989
by: Br | last post by:
First issue: When using ADPs you no longer have the ability to issue a me.refresh to save the current record on a form (the me.refresh does a requery in an ADP). We usually do this before...
5
3918
by: ortaias | last post by:
I have a form which calls up a second form for purposes of data entry. When closing the data entry form and returning to the main form, things don't work as expected. When I return to the main...
6
8519
by: Henry Stockbridge | last post by:
Hi, I have a popup that is used to update the records on an open form. I cannot get form to refresh with the new values. Any help you can lend would be appreciated. Here is the code for the...
6
5690
by: CJONES | last post by:
I have a main form and use a combo box to open a pop up form. The combo box lists customers and only one customer requires the fields that are found on the pop up form. I can get the form to pop...
0
7233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7342
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,...
1
7067
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
7505
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...
0
5650
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,...
1
5060
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...
0
4729
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...
0
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
440
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...

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.