Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Re-organisation / movement of fields within same Table

Status
Not open for further replies.

2122002

IS-IT--Management
Apr 22, 2003
58
US
Dear Expert,

I have a table which was delivered by a customer and is being messed up. What I want to do is to move/shift data/ROW/Column from one to another within the same Table.

Data in the table was initially converted from EXCEL to MS-Access and column heading is inside the recordsets.

Does anyone has VBA Scripts or solution to this or sometime similar solution???

Below is an example of how the table are wrongly organised:

Tablename: GeneralPractitioner

-------------------------------------------
Row1 |Johnson |20,MC Road | 40 |
------|---------------|-----------|--------|
Row2 |GPName | GPAddress | Age |
------|---------------|-----------|--------|
Row3 | |0795654536 |38 |
------|---------------|-----------|--------|
Row2 |GPContactPhone | GPAddress |Sex |
------|---------------|-----------|--------|
Row3 |John | |Male |
------|---------------|-----------|--------|
Row4 |Sex |Specialist |BloodGP |
------|---------------|-----------|--------|
Row5 |Dalton |James |O+ |
------|---------------|-----------|--------|
Row6 |Daylin |Tayo |O+ |
--------------------------------------------
Row7 |GPContactPhone | GPAddress |Sex |
------|---------------|-----------|--------|
Row8 |GPName | GPAddress | Age |
--------------------------------------------

Now, I want the table to be re-organise and should look like below assuming I have more than 15,000 records

----------|-----------|---|----------------|------|------
GPName | GPAddress |Age| GPContactPhone |BldGP |Sex
Dalton |20,MC Road |38 | 0795654536 |O+ | Male
John |20,MC Road |40 | 06978954536 |O+ | Male
----------------------------------------------------------

Please Help!.

Dan


Dan
 
1. Create a new query
2. Choose the "GeneralPractitioner" table
3. For Query-Type, select "Delete"
4. Double-click the field that has "GPContactPhone" values so it is in the grid
5. In the criteria section, paste ""GPContactPhone"

Run the query

You may need to do similar for the "Sex" column

Joe Schwarz
Custom Software Developer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top