recordset definition works on one db and not in another.

A

alidabiri

here's my code:


Option Compare Database
Option Explicit

Public Function sibbling1()
Dim rschild As Recordset
Dim streetx As String

Debug.Print "=== Start of subroutine ==="
Set rschild = CurrentDb.OpenRecordset("my_table")
rschild.MoveFirst
Do Until rschild.EOF
rschild.Edit
streetx = rschild!street

If streetx = "xxxx" Then
streetx = "1501 washington street, east"
rschild!street = streetx
rschild.Update

End If

rschild.MoveNext

Loop

rschild.Close
Debug.Print "=== end of subroutine ==="
msgbox("records were updated")

End Function

the problem is this works in one database. i copied the code and put
it in this database that contains "my_table" and it doesn't work.
 
S

Steve Conway

It is likely a reference problem. On the system that is not working, open
any code window and from the tools menu select references. Check for
Microsoft DAO 3.6 or any ref marked as missing. Depending on what version of
access you are using, A2k and > use ADO as default. Include the DAO ref and
you should be fine. If you will not be using ADO you can remove it. It is
also a good practice to disambiguate your declairations. ex Dim rschild As
DAO.Recordset.

HTH
Steve Conway
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top