Importing Data Problem (auto Primary Key)
Aug 11, 2006
Hi all, I currently have 2 databases: a main current database (Main.mdb), and a secondary database (Working.mdb).
They are identical, except the working database has no data, just the existing tables, forms, etc. from the main database.
When I (or a programmer) makes changes to the forms and some underlying calculations, they are first made in the Working database.
After the changes are made, i delete all the data from the tables in the working database (data from testing, etc.). I will then copy all of the data from the tables in the Main Database over to the Working database, then rename the Working Database to the Main Database.
The only problem I'm having right now is that the primary key in one of the tables (ClientID) is an autonumber. When I paste the data into the Working Database, all the ClientID numbers change. Is there any way to keep the numbers the same as the Main database?
Thanks in advance!
View Replies
ADVERTISEMENT
Dec 14, 2005
There are some web forms where people can submit work requests to my team. The data is fed into Excel in .csv format. Each request adds a new row to the spreadsheet. Nothing ever drops off.
I am having problems getting that data into my "final" Access tables without repeating the data with each subsequent import/append. There is no unique identifier in the Excel file, only the raw data, all fields of which could be duplicate across requests.(requestor, phone, request by date...) In my Access tables, I have the same fields as in the Excel file, along with an AutoNumber primary key and some additional fields where we can enter when work began and was completed and to who it was assigned.
Say for example 5 requests come in and thus create rows 1-5 in the Excel file. I then import the data into a temp table, and then append to my final table. Works. But say an additional 2 requests come in...I then do another import and append and my final table ends up with rows 1-5 AND 1-7.
I was thinking composite key of some sort, but none of the fields lend themselves to that. Plus I need the ability to edit some of the imported data once it hits my final table (ex: changing a request-by date or request detail), so a field by field comparison of the import table to my final table to determine uniqueness probably won't work either.
I'm thinking the solution would be to add a unique identifer at the source level, but I'm pretty much left to come up with a solution in Access as the web team's resources are unavailable for a few months.
Any ideas to get me started???
View 2 Replies
View Related
Apr 3, 2006
Loss of Primary Key when importing csv file
Hi All,
We are submitting an Access db table with ID as primary key to an outside company for processing. We export it as csv file and that's how it comes back.
After importing it back, we noticed that our IDs, which previously had 'gaps' as a result of deleted records, had been changed in to a new continuous sequence (Autonumbered). This, of course, completely destroys our database since related tables depend on IDs being unchangeable.
We ***suspect*** that the IDs are being destroyed during the process of re-importing the csv file. We are using the Access import wizzard.
Access msg: "Access recommends that you define a Primary Key for your new table". We then are given the following options:
1Let Access ADD primary key
2Choose my own primary key
3No primary key
During Option 1, the ID column is displayed and high-lighted. But we do NOT want that option since it offers to ADD a primary key, whereas we already have one (ID). At most, we want to 'declare' or 'define' a primary key, but we do not want Access to ADD one.
So we try Option 2, hoping that this will give us the chance to CHOOSE ID as our primary key. But the moment we select that option, the ID column disappears. We are not given the chance to select ID as our primary key.
So we try Option 3, hoping to re-instate ID as primary key as soon as we have an Access table again. But the moment we select this option, the ID column disappears.
-----------------------
If we GO THROUGH with Option 1, we notice that Access has renumbered our ID, the IDs of all our 'deleted' records have been re-assigned. Or so it appears.
If we GO THROUGH with Option 3, the resulting table does not contain an ID column at all.
Of course, the damage may have been done by the outside company which processed our file, but if so, we have to prove it, and we have to take measures to avoid it.
Any comments and advice?
Thanks.
Adrian
View 3 Replies
View Related
May 21, 2007
I have used priamry keys in my tables and these are set to auto numbers on the advise of fellow forumites.
One question if at the end of every year I need to upload batches of data to my tables, this would mean I would need to go through each record and manually enter the foreign keys in the linked table.
Surely Access has a better way of dealing with this issue?
View 5 Replies
View Related
Feb 8, 2008
Hi there.
I am creating a database and i have the layout I want. although I am having problems as i am using autonumber as the primary key in each of the tables. Is there are way to make this work as the data to be entered into this database does not have a natural key until they are 4 months into the process.
i have attached my relationships diagram.
if it is not a good idea to use an auto number as the primary key does anyone have any suggestions as to what i should use?
View 2 Replies
View Related
Feb 12, 2008
Hello ALL,
I want to know how to reset (to start again from 1) my primary key field. As an example i have the "Customers" table with the field "customerID" as PK now i entered many values (20) then i deleted them but i want to start again and the "customerID" value starts with 21 i understand that but i want a fresh DB (i was testing things) and i want to start from 1 can i? how? i even deleted the relation between this table and the other table but no success!
Some help please?
THX in advance
View 4 Replies
View Related
Oct 6, 2004
Hello,
I am a beginner and know a little about access. I am trying to create a customized Primary Key with an auto number. I want it to look like this: VP001 ,next record, VP002 and so forth. When I enter a new record and want it to do this automatically. It could be VP1, then VP2, I don't need the extra zeros but it would be nice. I don't know how to do this. If someone could please help walk me through this. Remember I am a beginner with databases and need help.
I would appreciate it
Thanks
Biz
View 2 Replies
View Related
Feb 13, 2008
Hello ALL,
I want to know how to reset (to start again from 1) my primary key field. As an example i have the "Customers" table with the field "customerID" as PK now i entered many values (20) then i deleted them but i want to start again and the "customerID" value starts with 21 i understand that but i want a fresh DB (i was testing things) and i want to start from 1 can i? how? i even deleted the relation between this table and the other table but no success!
Some help please?
THX in advance
View 2 Replies
View Related
Nov 19, 2011
Can I change the primary key currently set to my products description to an auto number? I'm trying to make things right, also does the foreign key get an auto number?
View 2 Replies
View Related
Jul 13, 2006
I am developing a DB that is composed of approximately 50 tables. The primary key in every table is automatically generated byAccess. I understand that the primary key for each record in the table has to be unique. My question is: Is the primary key uniqueness applicable across the entire DB?
For example, table A has a auto gen key #25 in it. Therefore, no key in table A can be #25. Now I make an entry in table B (A:B, is 1:many). Can the primary key in table B be #25? OR, once #25 is used and continues to exist, it cannot be used in *any* table?
I have made several small examples and the keys across all the tables are unique. I don't know if this is guranteed across all the db tables, or just in my particular case?
Thanks
John
View 1 Replies
View Related
Jan 24, 2007
Anyone...
Please can you tell me how I run a make table query that makes one of the fields a primary key. Can it be done in the query or do I have to set it as part of a macro that runs the query. If so How do I achieve this.
I am running a make table query from a link table so i can use it with infopath. I run the make table query every time I update the spreadsheet that the link table runs off and it makes a proper table with it for infopath to run off (because I can't get infopath to run off a link table, No primary key means it won't submit.) When I run the macro that runs the query and creates the table, I need it to make oone of the fields a primary key.
Any suggestions
View 3 Replies
View Related
Jun 19, 2013
When I first was making my database I used all auto numbers for PK's. But then I read an article or two saying that you really don't need to do that if you don't have to (actually, the article said "don't use autonumber if you want anyone to understand your database). I have a few tables (most employee experience type tables) where I just use the word as the PK and there is no auto number in the table at all.I continue to build my database?
View 14 Replies
View Related
Jun 23, 2013
Is there a way I can format AutoNumber for a primary key, for example, have the first ID start as C001 then for the next entry Access will automatically go to C002, and so on and so forth?
View 14 Replies
View Related
Jul 24, 2012
I have an infopath form, which people in my company can fill out to order parts. The form is linked to an Access database. The primary keys for the database are the Order Number and the Line Number (where the specific part info is in the system). The form also takes info about who entered the order, when they entered it, etc.
My problem is that while the form will be used for only one order, it may be used to order multiple parts. So the infopath form has a repeating section with a table where they can enter multiple line numbers and part names, etc.If I use the form to enter just one part, everything works great. But when I use the repeating section to add multiple parts, the information specific to the repeating section is added to the database but the rest of the information (who entered, when the entered, etc) isn't.
My intial idea was that since the first part is entered correctly and the subsequent parts are missing some information which is already in another line in the database. Maybe if there was a way to pull the information from another line into the lines with missing info within access would solve my problem. So basically automatically populating the rows with matching Order Numbers with the information that is missing.
View 7 Replies
View Related
Mar 13, 2014
My Access 2010 skill level is intermediate.I have a table with 4 fields.
EmployeeID (Primary Key)
LastName
FirstName
SupervisorID
The problem I have is that in the Supervisor field, it identifies the supervisor by his/her EmployeeID. I would like to create a query or merge tables so that the SupervisorID can look for a matching value in the EmployeeID field and return the last name/first name.
View 5 Replies
View Related
Jul 25, 2007
Hello,
Firstly, I am very much self-taught on access, so there are several gaping holes in my knowledge, and my database structure is probably not wonderful! I have been learning as I go along, so in the initial stages I have built in several problems which I am now discovering!
My db is designed to track suggestions - i have a table where the idea, progress etc is stored [tblIdeasBank]. This contains an 'originator' (person's name) which is linked to a second table, where the names are stored [tblPeople].
Originally I set up tblPeople with the Primary Key as FullName (e.g. Joe Bloggs) (guaranteed to be unique with the small number of people that would be involved), and a second field called InitialLastName (e.g. J Bloggs). It is this second field that is stored in the tblIdeasBank. Data verification came from the user having to select a name from a drop down box, so there is no actual 'relationship' between the tables. (Didn't realise how useful they were at the time!)
The db has been so successful :confused: that it is now going to be rolled out across the company, which gives me two problems. To populate all the names, I need to import them from Excel, where I will have FirstName and LastName. I have now realised that it would be more sensible to just store these, and create InitialLastName where needed. Also, I may well have duplicate names, so I need to create a unique ID, and a proper relationship. (Yes, I know I should have done that in the first place).
So, I have:
tblPeople:
.FullName (Primary Key)
.InitialLastName
tblIdeasBank:
.Originator (stored as InitialLastName)
And I would like:
tblPeople:
.PersonID (Primary Key)
.FirstName
.LastName
tblIdeasBank:
.IdeaID (Primary Key)
.Originator (stored as PersonID)
With a One-Many relationship from PersonID to Originator
Any ideas how I would go about doing this and changing the Originator for each idea from InitialLastName to the relevant PersonID number, without corrupting the data?
I have searched through Google and various groups, but cannot find a useful answer, so any pointers gratefully appreciated!
Thanks,
Nick
View 6 Replies
View Related
Dec 12, 2012
I'm using Microsoft Access 2007
I have three tables: the 1st is for product's identification, the 2nd is for registered products, and the 3rd is for under-registration products
and the primary key for the three tables is the Registration Number
and there is a one to one relationship between the product identification and the registered products
and a one to one relationship between the product identification and the under registration products
What I want to do is to make an append query to move the under registration product to the registered product when its process is over.
One of my problems is with the primary key for the under registration products table, as they only get their registration number when the process is over. so how can I enter data into this table without the value of the primary key ?
View 14 Replies
View Related
May 27, 2014
I have an access table which has a key using letters (A,B,C,D...etc). Against each letter there is multiple rows against each letter. However for testing purposes I only need to get a single row against each key and I was wondering if there is a function I could use which would return only the first record of data for each key?
View 4 Replies
View Related
Jun 6, 2006
I'm using a combo box control for searching employees. Which the empID is the unique key, the form is scrolling each record, do not want it to do that. When i click on an ID, it only changes ID's but not the information thats tied to that ID. How can I fix that? any valuable information is well appreciated. Thank you
View 3 Replies
View Related
Jul 16, 2007
Someone recently answered my query with regards to uploading data to an access table.
The first coloumn is an auto incremented number.
Will there be any problems with importing data - when one field is auto increment?
Obviously I wont be uploading values for this column - can that be done?
View 14 Replies
View Related
Nov 14, 2007
Hi,
Another question on this database I'm working on.
I have my database pretty much ready to go, but they would like to import data from another access database into this one.
The problem I'm seeing is, I've been working so hard to normalize my database with the proper relationships etc.
The database I'm importing from, the data there are all stored in huge tables.
so for example in my database I have our main table, that holds all like data. Then my other tables for specfic data that then relate to the main table ID.
The other database has everything in 1 table.
I've created a query and got what I needed from the other database, but not sure how to import it into my main table, and have it so the 'specific' data goes into the right table, and so the Main_ID field points to the correct record in my main table.
I don't think I explained that very well.
Here is how my structure is in the new database
tbl_main
Main_ID
Code_ID
Effective_Date
End_Date
Createdby_ID
tbl_CCE
Main_ID
Codeinfo
etc
etc
now the old database, everything is in 1 table and I'm not sure how to break it down so after I import the table CCE/Main_ID is the same as the Main_ID in my main table.
I'm still not sure if I explained that very well....
View 3 Replies
View Related
Aug 10, 2005
Hi
I'm trying to import data from an Excel spreadsheet into an empty table using the Import Wizard (File/Get External Data/Import). All's well until I'm presented with the window that tells me that I can "store" my data either in a new or existing table. However the radio button and Existing Table name field is grayed out. Any ideas gratefully received.
Baz
View 4 Replies
View Related
May 15, 2007
I'm hoping someone can help me with what (I think) may be a minor oversight by me.
I'm trying to import data from an Excel Spreadsheet into a table that I have already created for my job.
Both the table and the excel spreadsheet have a common factor which is an identification number. I would like to import the data into the existing table so that the additional values fall under the appropriate identification number.
I hope that makes sense - if not let me know and I'll try to explain further.
So my question is - is this possible? I searched the help files and some internet resources and couldn't find anything this very specific kind of importation.
If anyone could help me I would greatly appreciate it as you would save me tons of time.
Thanks in advance!
View 1 Replies
View Related
Feb 18, 2008
I have my sister using the db (in mde form).
When I make design changes to the mdb, I need to import (freshen) the data from her mde. (We're in different states) Obviously, when I do this, I get a duplicate table renamed.
If I do a query to freshen the data, will an update query just copy the changed/new data without the unchanged ?
Or is it best to just delete everything in the table and append the data from the mde table ?
Or is there a better way to do this that I'm not thinking about ?
View 14 Replies
View Related
Feb 18, 2008
Hi everione
I have to make a db that imports data from a textfile. I read the posts about automating the proces but I have two other problems. The text file is generated by a proces control software and has a .gbc extension ( I tried to solve this by importing to excel and then to acces) and the textfiles has a limited number of entries araound 300 so after al the records in the textfile are writen the records are overwriten. Is it posibel to make acce to read only the new records and adi it to a table witouth deleting the old records? the record has a date and time included.
Im a acces user for only two weeks so i would be greatful for any help.
View 5 Replies
View Related
Sep 11, 2006
HI I would like to design a form where user could be given an option to browse a database .mdb file and then select a table from that database that appears in a combo box and then a query should retreive all values from that selected table. I have tried with recordsset thing but error comes as Type Mismatch for
Set rs = Currentdb.OpenRecordset("strqry")
or when i tried using application.access thing. I still could not retreive list of tables. Thanks very much for suggessions that I am looking forward to.
Cheers
Abid
View 2 Replies
View Related