Results 1 to 3 of 3
  1. #1
    pjluckyman is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    2

    Looking for Access VBA assitance. Need to change code to look at table for a constant

    I currently have the ability to backup my database using a button. The VBA code has this line of code

    Const BACKUP_PATH = "C:\mycomputer\my folder\"

    I want to replace it with Const BACKUP_PATH = "form or table.field name". I want to be able to change the backup_file path depending on what computer the program is on so others can use the database with out having to know where to go and replace it in VBA.

    Short and skinny I'm looking for the code in the middle of the " "'s to have my VBA look in a table or form for the value. I currently have a table named Link to Save with the field LinkToSave, and my form "Administration" with the text field named BackupLink.

    Thanks in advance for your assistance.


    Pete

  2. #2
    pjluckyman is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    2
    Quote Originally Posted by pjluckyman View Post
    I currently have the ability to backup my database using a button. The VBA code has this line of code

    Const BACKUP_PATH = "C:\mycomputer\my folder\"

    I want to replace it with Const BACKUP_PATH = "form or table.field name". I want to be able to change the backup_file path depending on what computer the program is on so others can use the database with out having to know where to go and replace it in VBA.

    Short and skinny I'm looking for the code in the middle of the " "'s to have my VBA look in a table or form for the value. I currently have a table named Link to Save with the field LinkToSave, and my form "Administration" with the text field named BackupLink.

    Thanks in advance for your assistance.
    Pete
    I figured it out. BACKUP_PATH = Forms![Administration]![BackupLink] So simple it was hard!

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Thanks for posting your solution and welcome to the site!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Declaring a Variable Constant (Sort Of)
    By emmahope206 in forum Programming
    Replies: 1
    Last Post: 02-27-2013, 11:15 AM
  2. Column Headings - Change before uploading to Access Table
    By smoothlarryhughes in forum Import/Export Data
    Replies: 5
    Last Post: 11-08-2012, 12:33 PM
  3. Replies: 8
    Last Post: 01-30-2012, 02:13 AM
  4. Replies: 14
    Last Post: 08-04-2010, 07:34 AM
  5. Replies: 1
    Last Post: 06-09-2010, 04:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums