Senin, 09 April 2012

[MS_AccessPros] Re: Importing Data

 

Crystal,

I do not quite understand what you are saying below. I have multiple questions, I will try to ask them in order.

Where do I add a field for my main Key? Do I add it to the excel table I am importing or do I add it to the new table after all the information has been imported? I did import a table and let Access creat a PK.

I do not understand number 1. below. In the access table that I imported my data to I am supposed to...? I do not understand "where records exist".

I do not understan number 2 below because I do not understand number 1. I am having a tough day.

Based on number 4 it sounds like I should add some temporary fields to my access tables prior to the append. Then after I append I delete some fields?

I a copy of the database I did import some data. I learned that I really need to get my data in better shape before I import it. It is a lot easier to do in excel before I import it.

the FK of the second table that related to the PK of the first table was a problem.

If you could try to explain the above in rookie language that might help me.

Thank you very much.
Bill

--- In MS_Access_Professionals@yahoogroups.com, Crystal <strive4peace2008@...> wrote:
>
> Hi Bill,
>
> add a field for your main key (assume long Integer if key is an AutoNumber) to the import table. 
>
>
> 1. Update Main key in Import table where records exists
> 2. Append records that don't
> 3. update Main key for the newly appended records -- same query as #1 where MainKey Is Null
>
> 4. now all the import records should have the Main Key and you can shuffle fields out to your related tables.
>
> If you have more than one main key, do the same process fpr each
>
>
>
> Warm Regards,
> Crystal
>
> Microsoft MVP, Access
> remote training and programming
>
> www.AccessMVP.com/strive4peace
>
> www.YouTube.com/LearnAccessByCrystal
> www.YouTube.com/LearnByCrystal
>
> * (:  have an awesome day :) *
>
>
>
> ________________________________
> From: Bill Singer <Bill.Singer@...>
> To: MS_Access_Professionals@yahoogroups.com
> Sent: Monday, April 9, 2012 2:58 PM
> Subject: RE: [MS_AccessPros] Re: Importing Data
>
> Duane,
>
> I will try importing all the data into one table and then appending it into
> different tables.  I am still having a hard time figuring out how to
> maintain the integrity of the data as the two tables are related.  I will
> somehow have to make sure the FK in the second table lines up with the PK in
> the first table.  I have not yet figured out how to do that as the PK in the
> first table will not be created until I append the records.    I will have
> to add that to my append query somehow so the date in the second table
> related.
>
>
>
> Thanks,
>
>
>
> Bill Singer
>
>
>
> From: MS_Access_Professionals@yahoogroups.com
> [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Duane
> Sent: Friday, April 06, 2012 10:22 PM
> To: MS_Access_Professionals@yahoogroups.com
> Subject: [MS_AccessPros] Re: Importing Data
>
>
>
>  
>
> Bill,
> Consider importing into a temporary table where you can use the records to
> update or append to multiple tables.
>
> Duane Hookom
> MS Access MVP
>
> --- In MS_Access_Professionals@yahoogroups.com
> <mailto:MS_Access_Professionals%40yahoogroups.com> , "agent1of6"
> <Bill.Singer@> wrote:
> >
> > I have imported 1 Excel spreadsheet into 1 Access table before. Now I am
> being asked if I can import 1 Excel table into two tables. Actually the user
> does not care how many tables I have, they just do not want to type the
> information in. (700 records, 6 fields per record.) I have two table that
> store the data,with a one to many relationship. Can I import through a query
> to seperate the data the way it should be seperated?
> >
> > The first table stores a players name, address etc.
> > The second table stores what season the player is registering for.
> >
> > Over the years one player will register for multiple seasons... which
> brings me to the second issue. Next Year I may be asked to import records
> for players that are already in the database, How do I prevent that? In that
> case i would just want to import the new year they will be registering for.
> >
> > The data base works better if they inut each person one at a time but I
> understand that it is a lot of typing.
> >
> > Thanks
> > Bill
> > MN
> >
>
>
>
>   _____ 
>
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2012.0.1913 / Virus Database: 2409/4918 - Release Date: 04/06/12
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
> [Non-text portions of this message have been removed]
>

__._,_.___
.

__,_._,___

Tidak ada komentar:

Posting Komentar