-
Use current database
I am brand new to vba so hopefully this will be an easy question for most of you. I have an access database with a form and a button. When I press this button it runs some vb code which moves some files around on our network. What I want to do is to insert into a table (also in the same database) the filenames and a status depending on whether or not the file was moved successfully.
Now I am ok with creating connections to other databases but how do I tell it to use the current database?
Hope you can help! Thanks.
-
Hello,
You can use the following
Code:
CurrentDb.Execute "insert into logtable (status, filename) values (" & txtstatus & "," & txtfilename & ")"
where txtstatus is the status
and txtfilename is the file
kind regards,
V-Software
-
Thanks for that! I was hoping it would be that simple! ;)
-
hi
can u explain this code agian
biswajit das