how to affect the changes to the specific DB (1 Viewer)

mana

Registered User.
Local time
Yesterday, 19:13
Joined
Nov 4, 2014
Messages
265
hello

i have the below code and i want that my database will be affected after doing it
but in my target db nothing happens can you help me please?
thank you


Dim db As Database




Set db = OpenDatabase("G:\Rasteh Mona\nplsource _new - backup2 - forsecurity.accdb")
'DoCmd.RunSQL ("insert into checks_projects([Creation date]) select a.[Creation date] from (select [Creation date] from Query2) as a left join checks_projects b on a.[Creation date]=b.[Creation date] where IsNull(b.[Project name]);")



Set db = Nothing
 

Minty

AWF VIP
Local time
Today, 03:13
Joined
Jul 26, 2013
Messages
10,371
You are running your code in your local current database you are in, not the one you have opened...
If the tables you are trying to modify are in the other database you would have to link them into your current database to work with them.

If you had them linked your current database wouldn't need to open the other database to work with them...
 

mana

Registered User.
Local time
Yesterday, 19:13
Joined
Nov 4, 2014
Messages
265
sorry but i can't understand
i just make an accde file and wehn i create a new record in it it would not add in my table in my accdb file
can you help?
 

Users who are viewing this thread

Top Bottom