I have 2 option groups on my form, called OptConnection and OptTables. The OptConnection is a choice from different sources. I must select an option from the OptConnection and then select a choice from the OptTables.I am importing or linking different tables. For example the first choice in the OptTables is products, the second is customers. I am getting confused with the Select case and the If statements.Is there a shorter way to make the double choise?
Here is the abridged code i am working with:
==================================
Select case Me![OptConnection] ‘import from different databases
case 1 ‘ import from the server
If Me![OptTables] = 1 then ‘ import the tables products
DoCmd.TransferDatabase acImport, “Microsoft Access”, “C:bebe.mdb “, acTable, “products”, “products”
elseif Me![OptTables]= 2 then ‘ import the tables customers
DoCmd.TransferDatabase acImport, “Microsoft Access”, “C:bebe.mdb “, acTable, “customers”,”customers”
etc etc
end if
case 2 ‘ import from the database warehouse
If Me![OptTables] = 1 then ‘ import the tables products
DoCmd.TransferDatabase acImport, “Microsoft Access”, “C:MyDocumentswarehouse.mdb “, acTable, “products”, “products”
elseif Me![OptTables]= 2 then ‘ import the tables customers
DoCmd.TransferDatabase acImport, “Microsoft Access”, “C:MyDocumentswarehouse.mdb “, acTable, “customers”,”customers”
etc etc
=====================================================
I will be grateful for any help