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

The Alternative to CurrentDB 1

Status
Not open for further replies.

NiceArms

Programmer
May 21, 2009
105
GB
The following code does work for updating the current table, however I want to update another table.

I have tried changing "CurrentDB" to the Alternative table name but with no joy!

simply put, i want: "currentDB" to point an another table in the same access project.

'Updating a record in a table
Dim DB As Object
Dim Column As Object

Set DB = CurrentDb 'name of database
Set Column = DB.OpenRecordset("User") 'select column from the above database

Column.AddNew 'add a new item to database
Column("User").Value = User1
Column.Update 'Update the table!

Thank you

/Nice
 
where are you trying to change to anothe table

try
Set Column = DB.OpenRecordset("Someothertable")
 
Ah, thank you!

I was looking at the wrong bloody bit of code!

again, thank you.

/Nice
 
A good way to thanks pwise would be to click the

star.gif
Thank pwise
for this valuable post!


link under his post [smile]

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top