473,400 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,400 software developers and data experts.

Changing a record as it is imported into a table

46
Help,

I have an access 2007 database that imports data from an sql database, one of the fields can contain multible inputs. One of the is "Spec\Met\OEM", when it is added to table in my database I would like it to change to "Metro". How do I do this?

thanks,
Jeff
Mar 24 '08 #1
4 1350
Stewart Ross
2,545 Expert Mod 2GB
I have an access 2007 database that imports data from an sql database, one of the fields can contain multible inputs. One of the is "Spec\Met\OEM", when it is added to table in my database I would like it to change to "Metro". How do I do this?
If you are importing a table from elsewhere I would leave the contents of this field as it is. Should you want to have the value 'Metro' returned whatever the contents of the original field then create a new query based on your table and add a calculated field in your query which simply returns the value 'Metro'.

If you wish to return 'Metro' in place of the abbreviation 'Met' in your source table then add a small lookup table to your database. The lookup table only needs two fields - the abbreviation and a full name field. Create entries for each of the abbreviations in use. Add this lookup table to a query along with the imported table, joining the two together on the abbreviated field. That way you can include your explanation without changing the original data in any way.

-Stewart
Mar 24 '08 #2
jmar93
46
If you are importing a table from elsewhere I would leave the contents of this field as it is. Should you want to have the value 'Metro' returned whatever the contents of the original field then create a new query based on your table and add a calculated field in your query which simply returns the value 'Metro'.

If you wish to return 'Metro' in place of the abbreviation 'Met' in your source table then add a small lookup table to your database. The lookup table only needs two fields - the abbreviation and a full name field. Create entries for each of the abbreviations in use. Add this lookup table to a query along with the imported table, joining the two together on the abbreviated field. That way you can include your explanation without changing the original data in any way.

-Stewart
Hi Stewart,

Thanks for your reply, but unfortunitly I am brand new to Access and your answer is over my head. The reason I am trying to replace "Spec\Met\Oem" is because it is to large to be displayed in the forms and report I will be using.

thanks,
Jeff
Mar 25 '08 #3
Stewart Ross
2,545 Expert Mod 2GB
Hi Stewart,

Thanks for your reply, but unfortunitly I am brand new to Access and your answer is over my head. The reason I am trying to replace "Spec\Met\Oem" is because it is to large to be displayed in the forms and report I will be using.

thanks,
Jeff
Hi again Jeff. Two things: firstly, try to keep imported data in its original form, so that you can guarantee that nothing has been lost in the import process. Second, it is good practice to base forms etc not directly on underlying tables but on views of the data - Access queries, or in other databases SQL Views which provide sorted or user-organised presentation of the data. There is much more scope and flexibility in using Access queries, because you can specify the sort order, add calculated fields - new virtual fields based upon existing fields - and do things which add to the existing data without changing it. If you are new to Access then I guess you are new to database design, an aspect of all work on databases which comes before any live data is prepared or transferred.

What I referred to in my reply to your question was the following: if you have a single field value that is always the same in your original data - and I am not sure why this would be so at all - you can include that value in an Access query (to make sure you do not lose any existing information by excising it) but substitute in a form or report a new calculated field - a virtual field if you like - returning the value "Metro". In a blank column of the Access query editor you could add a field like this to do so:

NewSource: "Metro"

If, on the other hand, different values were returned - OEM on some rows, Met on others - you would use the lookup table to provide a one to many relationship between the imported table and the meaning of these cryptic abbreviations. The many side of the relationship in these circumstances would be your imported table, and the one side the lookup table.

-Stewart
Mar 25 '08 #4
jmar93
46
Hi again Jeff. Two things: firstly, try to keep imported data in its original form, so that you can guarantee that nothing has been lost in the import process. Second, it is good practice to base forms etc not directly on underlying tables but on views of the data - Access queries, or in other databases SQL Views which provide sorted or user-organised presentation of the data. There is much more scope and flexibility in using Access queries, because you can specify the sort order, add calculated fields - new virtual fields based upon existing fields - and do things which add to the existing data without changing it. If you are new to Access then I guess you are new to database design, an aspect of all work on databases which comes before any live data is prepared or transferred.

What I referred to in my reply to your question was the following: if you have a single field value that is always the same in your original data - and I am not sure why this would be so at all - you can include that value in an Access query (to make sure you do not lose any existing information by excising it) but substitute in a form or report a new calculated field - a virtual field if you like - returning the value "Metro". In a blank column of the Access query editor you could add a field like this to do so:

NewSource: "Metro"

If, on the other hand, different values were returned - OEM on some rows, Met on others - you would use the lookup table to provide a one to many relationship between the imported table and the meaning of these cryptic abbreviations. The many side of the relationship in these circumstances would be your imported table, and the one side the lookup table.

-Stewart
Hi Stewart,

My Access database is linked to a view of a SQL database so I talked to the IT manager and he changed the view to return "metro" whenever it encounters spec/met/oem, so that solved my problem. I really a appreciate your help as I want to learn how to do it myself.

thanks,
Jeff
Mar 26 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Warren Wright | last post by:
Hello, We maintain a 175 million record database table for our customer. This is an extract of some data collected for them by a third party vendor, who sends us regular updates to that data...
4
by: Skully Matjas | last post by:
I am using the following code (created by the wizard) to allow to bring my form to a particular entery. But when I edit the entery (ex: put new information into a blank cell), it puts that record...
6
by: David Gartrell | last post by:
Hi i'm trying to import an Excel Spreadsheet into Access2000 but the data types for two of the fields in my imported table are being identified incorrectly. Is there a way of using some VB code in...
22
by: RayPower | last post by:
I'm having problem with using DAO recordset to append record into a table and subsequent code to update other tables in a transaction. The MDB is Access 2000 with the latest service pack of JET 4....
5
by: MN | last post by:
Hello, I have a customer table and another table that I need to prepopulate with special customer IDs, unique and not sequential. Is there a way to configure Access to assign the customer ID to...
0
by: hagar | last post by:
Hi all, I have a problem which I can not understand why this is happening! Debugging this I actually see that it grabs first record then when stepping through code to the line rsImportTo.AddNew...
1
by: afromanam | last post by:
Hello, Good morning, I have a question, hope someone can help me. I have a table with say, 5 columns, each named A,B,C,D,E The table was imported from Excel, so picture please this:
25
by: tekctrl | last post by:
Anyone: I have a simple MSAccess DB which was created from an old ASCII flatfile. It works fine except for something that just started happening. I'll enter info in a record, save the record,...
12
by: tekctrl | last post by:
Environment; Win2K PC with 1Gb of RAM and plenty of HD space running Access 2002 Issue; Access presents a blank data entry form in the Forms view when the New Record icon is used. However, it...
0
by: trixxnixon | last post by:
i have a form that is being designed to pend requests in a requests database. the pend form is opened from an update form used by an employee to enter updates. when the pend form is updated, the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.