Results 1 to 6 of 6
  1. #1
    forestgump is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2011
    Posts
    8

    Reference a text box in vba

    Hi,



    I want the below vba to reference a text box in a form in this case "NameOfFile" and then when the below vba imports data instead of having "GPO_Data.csv" in the vba I can write the name of the file in the text box on the form and click update

    DoCmd.TransferText acImportDelim, "GPO_Data_ Import_Specification", "GPO_CoreData", "Z:\GPO_DataSet\GPO_Data.csv", False, "

    Any help would be appreciated.

    Regards,

    James

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,923
    Replace your argument with Me.YourControlName

  3. #3
    forestgump is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2011
    Posts
    8
    like this???

    DoCmd.TransferText acImportDelim, "GPO_Data_ Import_Specification", "GPO_CoreData", "Z:\GPO_DataSet\Me.text3", False, "

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,923
    Like this: "Z:\GPO_DataSet\" & Me.text3

  5. #5
    forestgump is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2011
    Posts
    8
    Excellent it works! Thank you

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,923
    Glad we could help. Be sure and use the Thread Tools and mark this thread as Solved.

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

Similar Threads

  1. need help with reference..
    By dada in forum Programming
    Replies: 3
    Last Post: 09-17-2010, 06:07 PM
  2. Reference table
    By Newcomer in forum Access
    Replies: 6
    Last Post: 06-03-2010, 03:08 PM
  3. Reference to a Query
    By starhannes in forum Forms
    Replies: 5
    Last Post: 05-09-2010, 02:53 PM
  4. Form Name Reference in VBA
    By Simon Sweet in forum Programming
    Replies: 0
    Last Post: 05-22-2008, 01:55 PM
  5. How to add Opensource reference???
    By loui in forum Access
    Replies: 0
    Last Post: 10-04-2007, 04:24 AM

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