I Need Help with Radio Buttons

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

I have a form containing three radio buttons and one
additional button. The addiontal button is tied to VBA
code which imports some text files into a table. I have
three different import speficiations and I would like to
tie each specification into one of the three radio buttons.

The below code is for the importation command:

DoCmd.TransferText acImportDelim, myspec, tablename,
strFolder & myfile

The 'myspec' variable is for the different specification
types. What I want to be able to do is have 3 radio
buttons, for 'specification1', 'specification2',
and 'specification3'. So when radio button one is
clicked, it sends specification1 into the 'myspec'
variable, and then imports the text file according to that
particular specification.

Thank You
 
Dim strMySpec as String
Select Case Me.OptGrpSpec
Case 1
strMySpec = "Specification1"
Case 2
strMySpec = "Specification2"
Case 3
strMySpec = "Specification3"
End Select
DoCmd.TransferText acImportDelim, strMySpec, tablename, strFolder & myFile
 
Back
Top