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

Renaming a set of records and keeping old

Status
Not open for further replies.

DIVINEDAR0956

IS-IT--Management
Aug 15, 2002
95
US
Is there an easy query that will let you pull a certain set of records and then rename only the one major field of the record to another name.

I need to create something that will pull a certain set of records and then rename them and they appear in the same table. I guess I need a copy routine but I'm not sure what I need.

Thank you for your time and patience. Darlene Sippio
dsippio@comtechsystems.com
 
I know how to do the make table query but how do I tell it what to rename. Do I do this in the criteria and how will it know which data in the field to rename. Darlene Sippio
dsippio@comtechsystems.com
 
Hi

You can 'rename' a column in a query using the syntax SELECT MyField As YourField FROM Mytable ...etc

is that what you are trying to do? Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thank you for your response.

Example:

I have four tables that one main primary key. The field name is JOBNUMBER. I want to pull a certain JOBNUMBER from each table along with corresponding fields "P0128" and change to a different JOBNUMBER "P0129" along with it's corresponding data in all fields.

Is there a way I can make a temporary table (I know iwth the make table) with the data that I want to change and then have an input box telling what information to pull from each table, change the one field and then put the information back into the main tables then pull it up in my forms.

I hope you understand.

Thank you. Darlene Sippio
dsippio@comtechsystems.com
 
Hi

OK, yes now I undertsand, but you do not need to go through the make table step.

Have a form with two text boxes (or better still a combo box and a text box, the combo box for the 'original' job number the text box for the new job number.

Say cboJonBob and txtJobNo

Have a command button, which executes the following SQL:

Dim strSQL as String

strSQL = "INSERT INTO JobTable SELECT " & txtJob & " AS JobNo, ..etc the other fields"
DoCmd.RunSQL strSQL





Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top