I receive a text file with data for 11 unique medical groups.
Tablename: ELIGIBILITY(ALL GROUPS)
Sample:
Code: Select all
REC# H/T GRP CODE GROUP NAME DOB ETC.......
1 H S 005200 ABC
5123 T
5124 H S 005204 DEF
6602 T
6603 H S 009695 GHI
7344 T
7345 H S 020637 JKL
8112 T
8113 H S 024058 MNO
8462 T
8463 H S 024365 PQR
9228 T
9229 H S 024624 STU
9902 T
9903 H S 025944 VWX
9904 T
9905 H S 025945 YZA
9906 T
9907 H S 025946 ZXY
9908 T
9909 H S 025950 POY
9910 T
I need to make 11 separate tables from this main table.
Currently I have a generic Make table query, and manually enter the Between rec#s for each separate table I require. I also have to manually change the Destination Table to the appropriate table I am making. I have to do this 11 times.
SELECT [ELIGIBILITY(ALL GROUPS)].* INTO [ABC TABLE] <-- Manually change 11 times
FROM [ELIGIBILITY(ALL GROUPS)]
WHERE ((([ELIGIBILITY(ALL GROUPS)].REC#) Between 1 And 5123)); <-- Manually change 11 times
Is there a better way to do this? I’d be more than glad to use a form with VBA, but I cannot figure out where to start !
Any help is appreciated.
Michael