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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combining fields-JeanW help me

Status
Not open for further replies.

Tearose

IS-IT--Management
Jan 12, 2005
241
US
I'm still trying to improve on this 11 year old database. We want to combine the info from some fields (like 3 or 4 old fields into one new one). My idea is to duplicate the database, and in the new one, delete the old fields that we want to combine and create new fields for the combined data. Then import data from the old database fields into the new database fields (using the location # field as a match field.) I would repeat the import several times to get all the old fields moved into the new combined ones. Will this work? Or will successive imports replace the previous ones, instead of adding to them?
If that won't work, the alternative is to create the new fields, make a layout that has each group of old fields with the new field, and click through all 6000 entries, copying and pasting any data in the old fields to the new ones. Then I can delete the old fields from all layouts, replace with the new fields, and finally delete the old fields from the database.
I tested out a previous way of combining fields, but I couldn't write to the combined field anymore.
Thanks for your help,
Jill
 
Try using a script like this

Go to Record/Request/Page [First]
Loop
Set Field [CombinedField,Field1 &" "& Field2 &" "& Field3]
Go to Record/Request/Page [Next, Exit after Last]
End Loop

After running the script, you can then delete the old fields.


Hope That Helps
John
 
I haven't had a chance to try that yet, but I did take a few minutes to see that I could set up that script once I create the combined fields. You're sure I'll be able to write to the new fields after I get all the other field data into them? Can the old fields be deleted from the database, or just from the layout? Thanks,
Jill
 
Hi Jill,

The script that John suggests is sound. You should be able to create the new fields and them populate them using the script. You can then either just delete the old fields from the layout or delete them from the database completely. The choice is up to you.

-Striker
 
Hi Jill,

I would follow Johns script in your new file.
But be aware that if your old file has relationships, those will not work when you use another name for your new file.

Anyway, after combining the fields to new created fields, remove the old fields from your layout, but NOT from the database now.
Rename them with a prefix like z_yourFieldName. This will put those fields at the bottom of the fieldlist.
They will still hold your data.

Later, when you're sure everything is working smootly, you could use those fields as 'new' by renaming them again for new fields you need.
Usually I make them 'global', so they don't hold data anymore.

Deleting fields from a database can mess up importscripts, should you use them (experience).

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top