PDA

View Full Version : reference a text box in a form VBA



forrestgump
04-25-2011, 02:24 AM
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.

SoftwareMatt
04-28-2011, 09:20 AM
The code would be as follows:

DoCmd.TransferText acImportDelim, GPO_Data_ Import_Specification, GPO_CoreData, "Z:\GPO_DataSet\" & Me!TextBoxName, False,

Just replace TextBoxName with the actual name of your textbox.