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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|