I Need Help with Radio Buttons

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
 
D

Duane Hookom

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top