Button to update field in diff DB

jo15765

Registered User.
Local time
Today, 00:17
Joined
Jun 24, 2011
Messages
130
***These are both Access 2000 databases.

I want to put a button on a form in DB1, and when the button is pressed, I want to update field1 (or whatever the field is called) in DB2 to "Richard (or whatever value is decided to be set)." What VB code would I need in order to make this happen? I think it would be something similar to this, but I am missing the if....then portion of it.


Private Sub Update()
Dim IsFormLoaded As Boolean
Dim AccessDB As DAO.Database

IsFormLoaded = False

If ....... Then

End If
 
Why use code when you can just run an update query to set the field value in DB2?

UPDATE Contacts IN 'D:\MyFolder\DB2.mdb'
SET FirstName = 'John'
WHERE ContactsID = 5;

JR
 
That code would work, from just pushing the button on my form? Is it possible, to once you click the button, it asks what value you want to update field1 to? And then it update field1 to the value entered?

I think I can set up the update query to run this way, but I am not 100% sure? Thoughts? Ideas?
 

Users who are viewing this thread

Back
Top Bottom