record set to change field

bonekrusher

Registered User.
Local time
Today, 09:37
Joined
Nov 19, 2005
Messages
266
Hi all, I am trying to update a field based on another field through a record set. In this code I want to update SYS if Element_label is like 3 (the field has values 3.1, 3.3.1 etc...). Am I going about this the right way?

Code:
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("description")
While Not rst.EOF
    With rst
    If rst![Element_Label] Like 3 Then
    rst![sys] = 3
   
    Else: End If
      End With
rst.MoveNext

Wend
 
Are you getting any error messages when you run this? Another way to do it might be to use an update query as well.
 
Thanks, thats what I needed to do. It was so easy it slipped past me.

Thanks
 

Users who are viewing this thread

Back
Top Bottom