By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,327 Members | 1,806 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,327 IT Pros & Developers. It's quick & easy.

Insert question

P: n/a
ams
I set up a database of civic league members and residences.
I set the primary key to conform to addresses by street numbers.
Unfortunately, I omitted two buildings.
How do I insert the data for these two items where they should be ?
The Primary Key doesn't seem to like that :(

Thanks much,
newbie here
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
OM
"ams" <no**@cox.net> wrote in message
news:m2Lqc.31352$Md.29945@lakeread05...
I set up a database of civic league members and residences.
I set the primary key to conform to addresses by street numbers.
Unfortunately, I omitted two buildings.
How do I insert the data for these two items where they should be ?
The Primary Key doesn't seem to like that :(

Thanks much,
newbie here


I've just done this (and probably did it a very roundabout way), but I used
a make table query, with the records sorted the way I wanted, but without
the Primary key, to make a new Temp table. I then deleted all the records
from the original table, and used an append query to add the sorted ones
from my new Temp table, then deleted the Temp table.

Hey ! Worked for me !

Rob Lepper
Nov 12 '05 #2

P: n/a
ams

"OM" <le******@loxinfo.dot.co.th> wrote in message
news:c8**********@news.loxinfo.co.th...
"ams" <no**@cox.net> wrote in message
news:m2Lqc.31352$Md.29945@lakeread05...
I set up a database of civic league members and residences.
I set the primary key to conform to addresses by street numbers.
Unfortunately, I omitted two buildings.
How do I insert the data for these two items where they should be ?
The Primary Key doesn't seem to like that :(

Thanks much,
newbie here
I've just done this (and probably did it a very roundabout way), but I

used a make table query, with the records sorted the way I wanted, but without
the Primary key, to make a new Temp table. I then deleted all the records
from the original table, and used an append query to add the sorted ones
from my new Temp table, then deleted the Temp table.

Hey ! Worked for me !

Rob Lepper

Thanks, Rob. I did the round-about as well. I exported in Excel format.
Inserted the two buildings, and imported back into Access with a new table
name.

Much appreciated.
ams
Nov 12 '05 #3

P: n/a
The order that items are in a table should be irrelevant to you. If you want
them sorted, use a query. You can set sorting options in a query. Also, if
by inserting into the primary key, you mean that you have an autonumber and
you want to insert into the middle of it then - don't. Autonumbers will give
each record a unique ID, beyond that they have no meaning. You shouldn't
expect to be able to keep them lined up. If you need a field to do that,
you'll need to create one yourself. You could then have updated the ones
beyond where you wanted to insert by running an Update Query to add 2 to
each of the values beyond that point then inserted your other 2 records,
setting the field value to the sequence that you want.

--
Wayne Morgan
Microsoft Access MVP
"ams" <no**@cox.net> wrote in message
news:m2Lqc.31352$Md.29945@lakeread05...
I set up a database of civic league members and residences.
I set the primary key to conform to addresses by street numbers.
Unfortunately, I omitted two buildings.
How do I insert the data for these two items where they should be ?
The Primary Key doesn't seem to like that :(

Thanks much,
newbie here

Nov 12 '05 #4

P: n/a
ams
Wayne,

I was more or less asking, how do you insert a new row with new data in
between existing
rows that already have a primary key assigned. For some reason, in the
table dataview mode,
I am unable to insert such a row between existing ones. I will try out the
Update Query as you
suggested.

I know, I am not explaining myself well. Sorry.
Thank you,
ams
"Wayne Morgan" <co***************************@hotmail.com> wrote in message
news:gK******************@newssvr31.news.prodigy.c om...
The order that items are in a table should be irrelevant to you. If you want them sorted, use a query. You can set sorting options in a query. Also, if
by inserting into the primary key, you mean that you have an autonumber and you want to insert into the middle of it then - don't. Autonumbers will give each record a unique ID, beyond that they have no meaning. You shouldn't
expect to be able to keep them lined up. If you need a field to do that,
you'll need to create one yourself. You could then have updated the ones
beyond where you wanted to insert by running an Update Query to add 2 to
each of the values beyond that point then inserted your other 2 records,
setting the field value to the sequence that you want.

--
Wayne Morgan
Microsoft Access MVP
"ams" <no**@cox.net> wrote in message
news:m2Lqc.31352$Md.29945@lakeread05...
I set up a database of civic league members and residences.
I set the primary key to conform to addresses by street numbers.
Unfortunately, I omitted two buildings.
How do I insert the data for these two items where they should be ?
The Primary Key doesn't seem to like that :(

Thanks much,
newbie here


Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.