Share this Page URL

Chapter 5. Using Visual Basic to Automat... > Understanding Scope and Variables - Pg. 152

Using Visual Basic to Automate Your Database 152 5. After the statement Set db = CurrentDb, enter this statement: strImportTable = InputBox("Enter the table you're importing data into") 6. This statement assigns to the string variable strImportTable the name of the table that will be entered in the dialog box displayed by the InputBox function. Change the statement Set tbl = db.TableDefs("CampaignExpenses") to read as follows: Set tbl = db.TableDefs(strImportTable)