Hi:
I am finally trying my hand at modules and VBA. I have converted some of my macros into modules and now would like to streamline some of the commands.
One of the lines of the module imports a text file into a table.
Dim FALL01 As String
Dim SPRING02 As String
FALL01 = "C:\SQR\FALL01.TXT"
SPRING02 = "C:\SQR\SPR02.TXT"
DoCmd.TransferText acImportFixed, "FALL01 Import Specification", "CHOOSE-S", FALL01, False, ""
Where FALL01 is the path per above.
What I would like to do is for the user to choose which semester they would like to import.
IF [FORM].[F-TEST FUNCTION].[SEMESTER]= FALL01
THEN
DoCmd.TransferText acImportFixed, "FALL01 Import Specification", "CHOOSE-S", FALL01, False, ""
Else
DoCmd.TransferText acImportFixed, "FALL01 Import Specification", "CHOOSE-S", SPRING02, False, ""
End If
This is from a form's unbound textbox. Here the user can enter the file for the semester they need imported. But I get a syntax error when I try to run this procedure.
Can anyone help?
Thank You
Judy
I am finally trying my hand at modules and VBA. I have converted some of my macros into modules and now would like to streamline some of the commands.
One of the lines of the module imports a text file into a table.
Dim FALL01 As String
Dim SPRING02 As String
FALL01 = "C:\SQR\FALL01.TXT"
SPRING02 = "C:\SQR\SPR02.TXT"
DoCmd.TransferText acImportFixed, "FALL01 Import Specification", "CHOOSE-S", FALL01, False, ""
Where FALL01 is the path per above.
What I would like to do is for the user to choose which semester they would like to import.
IF [FORM].[F-TEST FUNCTION].[SEMESTER]= FALL01
THEN
DoCmd.TransferText acImportFixed, "FALL01 Import Specification", "CHOOSE-S", FALL01, False, ""
Else
DoCmd.TransferText acImportFixed, "FALL01 Import Specification", "CHOOSE-S", SPRING02, False, ""
End If
This is from a form's unbound textbox. Here the user can enter the file for the semester they need imported. But I get a syntax error when I try to run this procedure.
Can anyone help?
Thank You
Judy