A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Form Does Not Go To New Record



 
 
Thread Tools Display Modes
  #1  
Old May 11th, 2004, 06:20 PM
Steve
external usenet poster
 
Posts: n/a
Default 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


  #2  
Old May 12th, 2004, 03:15 AM
Allen Browne
external usenet poster
 
Posts: n/a
Default Form Does Not Go To New Record

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" wrote in message
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?



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:53 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.