Sorting data from single column

S

stoked_uk

Hello, I would be extremly grateful if someone could help me with this problem!
I have a single table with 2 columns and I need to sort the table into
patient records but the patient identifier also has associated data beneth it
until it gets to the next identifyier eg. 1234567891 being the identifier
with the code beneth. all the identifiers are alway 10 numbers long and the
codes are alph numeric.

Field1 Field2
1$ 1234567891
2$ m45hd
2$ m76yf
2$ m91ka
1$ 9874563210
2$ m74u9
2$ m65kd

If I could somehow move the ID into a seperate field and then copy the ID
down until there is a different ID?

Thanks again for anyone who could help!
 
O

OfficeDev18 via AccessMonster.com

Can you add a third field to the table, maybe called PTData. You can then run
a query as follows:

DoCmd.RunSQL("UPDATE YourTableName SET PTData = Field2 WHERE Where Field1 =
'2$'")

You can then delete the extraneous records with another query, as follows:

DoCmd.RunSQL("DELETE * FROM YourTableName WHERE Field1 = '2S'")

Once you do the above, of course, you would:

1) Delete the Field1 from the table, as it's no longer necessary, and

2) Change your underlying program to save future patient data in the field
PTData.

HTH
 
Top