Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2006
    Posts
    3

    Programmers help needed

    heres the scenario:
    I open access, i open my data base, after opening it i right click on tables and move down to import, i click and the import browser opens,

    this is my question:
    what is the visual basic code for that? i need it so that i can re-create this scenarios for other users but maintain the security of them not being able to get there..
    thank you
    nathan

  2. #2
    Rhino373 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    65
    Look into the standard Windows File Open/Save dialog box and the TransferSpreadsheet or TransferText commands. It would be a combination of these 2 things.

  3. #3
    alsaf is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    12

    Post

    It can be done two ways, either by creating a macro which is easier to configure if you are are beginner and use the following vba code:

    DoCmd.RunMacro ("macro name")

    where

    macro name is name of macro

    or use the following VBA command:

    DoCmd.TransferText acImportDelim, "database_import_spec", "database_table", "filename", False

    Where:

    database_import_spec
    is the import specification defined when importing text file manually
    database_table is the name of database table you want contents of text file to be imported into
    filename is name of text file

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    let me add that you in addition to transfertext there is also transferspreadsheet and I think 1 or 2 others. But just a word of warning, not matter what you do if someone is savvy enough to look at the code of your database they will be able to get to the original file. The only way to truly prevent someone from knowing where the source file is is to make your database a .mde or .accmde file and install only the run-time components of Access on the machine in question. If the user has a full version of Access there's no way to stop them if they know what they're doing other than setting network permissions like read only.

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

Similar Threads

  1. Replies: 4
    Last Post: 08-19-2011, 01:53 PM
  2. Datediff() help needed
    By geoff44 in forum Access
    Replies: 2
    Last Post: 11-20-2008, 04:44 PM
  3. Help needed desperately
    By tinyuna in forum Access
    Replies: 0
    Last Post: 05-03-2007, 02:18 AM
  4. Replies: 0
    Last Post: 01-01-2007, 02:26 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