Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use Edit method...

Status
Not open for further replies.

Porsche996GT2

Programmer
Oct 13, 2004
41
US
Hello all,

I'm trying to use the Edit method in Access to change an item of a recordset into something else. Here's the code that I have:

Sub Update2()

Dim dbsOPSTool As Database
Dim Logoff As Recordset
Dim LOS As String
Dim NewLOS As String

NewLOS = 2

Set dbsOPSTool = OpenDatabase("OOPS.mdb")
Set Logoff = dbsOPSTool.OpenRecordset("tblMaintenance")

With Logoff
.Edit
LOS = !LogOutStatus
!LogOutStatus = NewLOS
.Update
End With

End Sub


I try to run this and it's giving me a message that the Edit method is not a data member or it's not found. I also have DAO 3.6 enabled in my references. How do I get this to work? Please help! Thanks in advance.
 
Replace this:
Dim Logoff As Recordset
By this:
Dim Logoff As DAO.Recordset

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hello PHV,

Thanks for your reply. Is there something else that I need to add to my code? I still can't change the value in my recordset.
 
You have to use either the FindFirst and/or MoveNext method.
In other words, you have to choose which record(s) you want to update.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hello PHV,

Thanks again for your reply. I actually used MOVEFIRST because I only have one record in that table which has a value of 1. The code is still not changing that to 2. Any other suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top