Results 1 to 4 of 4

Thread: Use current database

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2003
    Posts
    7

    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.

  2. #2
    Addicted Member
    Join Date
    Jun 2002
    Location
    Brugge, Belgium
    Posts
    208
    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2003
    Posts
    7
    Thanks for that! I was hoping it would be that simple!

  4. #4
    Banned
    Join Date
    Jul 2003
    Location
    New delhi
    Posts
    143
    hi
    can u explain this code agian


    biswajit das

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width