How to move to the next record 
Author Message
 How to move to the next record

Cliff,

The problem is that your modifications via code are dirtying the record
after it has been saved.  If you try to move to a new record, thereby saving
the record then redirtying it, your record will be dirtied again, ad
infinitum.  If you move your code to the form's BeforeUpdate event, the
changes will be made prior to the initial save, and the vicious circle of
saving and redirtying will be avoided.

HTH,
Nicole


Quote:
> I put the following two lines of code in the
> After Update event on a form:

> Private Sub Form_AfterUpdate()
>     dtmChangeDate = Now()
>     strLastUser = strLogon
> End Sub

> The first line sets the dtmChangeDate field to
> the current date and time and the second line
> sets the value of the strLastUser field to the
> variable strLogin which is assigned when the
> database is opened. My problem is that if a
> record is changed, the updates to the fields take
> place, but the current record stays displayed.
> When I click the next record button (on the
> Navigation buttons), it won't move to the next
> record. I can move to other records if I do not
> makes changes to the records. What lines of code
> do I need to add to the After Update event?



Wed, 27 Mar 2002 03:00:00 GMT  
 How to move to the next record
I put the following two lines of code in the
After Update event on a form:

Private Sub Form_AfterUpdate()
    dtmChangeDate = Now()
    strLastUser = strLogon
End Sub

The first line sets the dtmChangeDate field to
the current date and time and the second line
sets the value of the strLastUser field to the
variable strLogin which is assigned when the
database is opened. My problem is that if a
record is changed, the updates to the fields take
place, but the current record stays displayed.
When I click the next record button (on the
Navigation buttons), it won't move to the next
record. I can move to other records if I do not
makes changes to the records. What lines of code
do I need to add to the After Update event?

Thanks for the help.

Cliff

Sent via Deja.com http://www.deja.com/
Before you buy.



Thu, 28 Mar 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to move to the next record?

2. Disable move to prev/next record when turning mouse wheel

3. How to move to the next record?

4. Disconnected Recordset will not move to the next record

5. How to make combo box move to next record

6. Doing Error Checking before moving to next record

7. Move next takes user to new record - not wanted

8. Move Next Record

9. Data control will not refresh/move to next record

10. Move to next record in DAO

11. Move Next or move previous

12. Enter,Next Row and Clear for Next record

 

 
Powered by phpBB® Forum Software