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

EXPERT HELP!!! PULL DATA FROM A TABLE AND RENAME DATA

Status
Not open for further replies.

DIVINEDAR0956

IS-IT--Management
Aug 15, 2002
95
0
0
US
I am fairly new at all of this I am beginning to see. So I know there are some experts out there that know some short cuts and can help me through my drama ordeal.

I want to pull information from a table and insert into another table and rename the first field information in that table. For Instance:

Project Table:

Column1: Project Number (key field)
Column2: Customer Name
Column 3: Address, etc.

Edit Project Information: (key field)
Column1: Project Number
Column2: Customer Name
Column 3: Address, etc.

I want to take all the related information to a certain Project Number from the Project Table and put it in the Edit Project Information Table and replace that Project Number with a new Project Number.

Can I use a query and if so I think my problem is finding the right criteria to ask what Project Number to change and what to change it to.

HELP PLEASE.

Thank you in advance for your help.

Darlene Sippio
dsippio@comtechsystems.com

 
Thank you Bill. But I work with Engineers and trying them to get to learn that all you do copy and paste the records you want in another table then do replace is not that simple to them if you know engineers.

I would really like a VB script that will do it for me and maybe I could use it in different areas of my database. So if you know of the sort please inform.

Thank you.
 
Are you familiar with Recordset concepts? You need to look into ADO properties.(VBA CODING)
Use 2 recordsets. use 1 recordset to fetch the fields based on the WHERE PROJECT_ID= (user entered value) forms!formname!combobox Store this in another variable like this
if not RecordsetName.EOF then
Var_Project_Id =RecordsetName!project_id
var_pName = RecordsetName!project_id
......
''You can use insert statment here within loop
Insert into EDITPROJECTINFO VALUES(var_projectID,VarPname.....)

and another recordset to update the and insert into Editproject.
Once you insert open one more recordset and update the project ID. Be careful to use the WHERE clause other wise it updates all the project ID to same numbers.

WHether you are inserting or updating VB code requires Quotes for string and # for dates.

You can write simple code to add a new projectID into Edit..table.

This is helpful to you.

I strongly suggest you to go through help ADODB.connection, ADODB.command and ADODB.RECORDSET objects.
Then you are set to go.

ALL THE BEST
 
Hi.

Take a copy of the table and (eg tmpProjTab).
Decide what is going to change.
From here you have 2 choices :

1. Change the values yourself (By hand)
2. Create a table which contains the old project numbers, and the new project numbers. Use this to write an update query to change the numbers to their new values.

Unless you have a set algebraic expression which will transpose values from the old project numbers to the new ... you'll have to do it by hand.

I may be misunderstanding what you are saying here so I will reiterate what I believe your question is :

I wish to find an easy way to transpose record numbers to new record numbers.

If so, then this is my answer.

Regards,
Mr Big
 

Hi Darlene:

I may be missing something. If so, just write this off. But...

1) if you are making a new table, use a maketable query.

2) if you are inserting records from one table into another, use an append query.

Hope this is helpful, Gus Brunston [glasses] An old PICKer, using Access2000.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top