Updating table

kirkm

Registered User.
Local time
Tomorrow, 10:15
Joined
Oct 30, 2008
Messages
1,257
I'm updating various fields in my table from two recordsets like so
Code:
If Nz(Dest!Year) <> Nz(rst!Year) Then
                                Dest.Edit
                                Dest!Year = rst!Year
                            End If
                            If Nz(Dest!AlbumTrack) <> Nz(rst!AlbumTrack) Then
                                Dest.Edit
                                Dest!AlbumTrack = rst!AlbumTrack
                            End If
                            If Nz(Dest!Year) <> Nz(rst!Year) Then
                                Dest.Edit
                                Dest!Year = rst!Year
                            End If
Do I need .Update for every .Edit, or can .Update run just once before .MoveNext ?

Or should I use an update query instaed ? I want to process various fields ... if they're different make Dest = rst.
 
You could put a single Edit before all the tests and a single Update after. An update query would certainly be more efficient if the situation allows it.
 
Thanks Paul, I thought I'd tied that without success but it's working now.
An update query might be problematic checking each first ?
 

Users who are viewing this thread

Back
Top Bottom