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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi! I am trying to open two tables

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
CA
Hi!
I am trying to open two tables and then update on of them assigning the values from the first table
Here is the code use
But it doesn't work, giving me the error message "NO CURRENT RECORD"


Dim rst As DAO.Recordset
Dim rst1 As DAO.Recordset

Set rst = CurrentDb.OpenRecordset("Configuration")
Set rst1 = CurrentDb.OpenRecordset("ConfigurationHistory")



rst1.Edit
rst1!ModelID = rst!ModelID
rst1!Model = rst!Model
rst1!DateObsolete = Now()
rst1!UnitPrice = rst!UnitPrice
rst1!RecoveryCharges = rst!RecoveryCharges
rst1!RecoveryChargesUSA = rst!RecoveryChargesUSA
rst1.Update

Please help
 
You have to move to a record first. You can use MoveFirst, MoveLast, Seek etc to select a record to update. Have fun! :eek:)

Alex Middleton
 
Also, I work with recordsets a lot and I tend to see that message constantly.

No records in your tabloe. If your recordset is empty (talbe/query returns no values).. etc.. Then you'll get get this message when you try accessing the Recordset.

Go in and make a fake record real quick in your table, then try again.

-Josh ------------------
-JPeters
Got a helpful tip for Access Users? Check out and contribute to 'How to Keep Your Databases from becoming Overwhelming!'
thread181-293590
jpeters@guidemail.com
------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top