Editing a recordset

Matty

...the Myth Buster
Local time
Today, 17:16
Joined
Jun 29, 2001
Messages
395
I'm trying to update a recordset with data entered in a textbox on a form, but the Edit property of the recordset isn't available. Here is my code so far:

Dim Response As Integer
Dim db As Database
Dim rst As Recordset

Set db = CurrentDb()
Set rst = db.OpenRecordset("RESPIRAT", dbOpenDynaset)

Response = MsgBox("Are you sure you want to replace the old date?", vbOKCancel)

If Response = 1 Then
With rst
.Edit <--- Error
!F_UP_DATE = Forms!Cancelation!Text25.Text
.update
End If
rst.close


Why can't I access the Edit property?
 
The error I get is --

Compile Error: Method or Data Member not found
 
Try opening up a module, going to the tools menu and selecting references. If any of the checked items say MISSING next to it, uncheck the box. Hope that helps.

Doug
 
I looked at the references window and from what I see, I don't see "missing" anywhere. It's really weird. I've used that Edit property before...Does my code look alright? I'm sorta new to VB, if you havent noticed...
 
It looks fine to me... The only thing I see missing is the "End With" command, but I'm sure you just forgot to paste it, and that wouldn't be your problem anyway. Is the recordset a query? And if so, is it an updateable query? That could be your problem.
 
The recordset is a table, and I'm using Access 2000. It's just that when I type rst. the Edit property should be in that little menu that pops up, but it isn't. I'm completely stumped, but I hope you people out there aren't...
 
Open any code page and go to Tools - References. Scroll down and click on Microsoft DAO 3.6 Object Library. Go to you code and make this change:

Dim rst As DA0.Recordset

Hope this works for you.
 
The only reason why the edit property does not pop up is that you do not have a DAO Reference. Try to open the module again and go to tools - References amd make sure a Microsoft DAO Library is checked (though i am not sure which version is for Access 2000 but try the highest Version).
 
Thanx for the help. I'm an idiot. I just forgot to put the DAO.recordset in my Dim statement. I did it in all the other programs, just not this one. Its friday, so that's the best excuse I've got.
 

Users who are viewing this thread

Back
Top Bottom