Results 1 to 7 of 7
  1. #1
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453

    append query


    Hi

    Have a spread sheet with 1500 records and every record has one field exactly the same
    the name of the Parish.

    My database has two tables

    parish and baptism based on a one to many realtionship.

    The parish has an id field and the church has fkId

    is there a way to run an append query to two tables or do I have to run two separate appends?

    thanks

    Ian

  2. #2
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    sounds like more information is needed. if i understand right you have two tables, parish and baptism, both have a field called parish. what are you trying to update?

  3. #3
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453

    Append

    Hi

    point taken I should have included the database :-(

    Simply there are three tables

    one for Parish

    One for Births

    these are in a relationship based on 1 to many as one parish can have many births

    The third is an import from the original spreadsheet

    I'm trying to append the contents of the" tbl_westburyBaptismsOne" to the other two tables whilst creating / retaining referential integrity between keys.

    The reason why there is a field in tbl_Parish called form name is that I intend to use the access property of using the 1st field as in

    Code:
    Private Sub Search_Click()
    If Me.Select_Parish <> "" Then DoCmd.OpenForm "frm_" & Replace(Me.Select_Parish, " ", "")
    End Sub
    No applicable to my current issue but thought I'd mention it.

    I will have over the next few months 54 parishes each with up to 10 spreadsheets so I'm trying to get my methodology right with just one to start with and from there set up a trial form sequence.

    IN case anyone wonders why this is the format it is a transcription of a 1600-1700 church birth register typed into a spreadsheet by hand ( not by me)


    Thanks

    Ian
    Attached Files Attached Files

  4. #4
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    are you wanting to run the append through code or macro? not really understanding why you are updating tbl_parish though since you know that you will have 54 parishes this becomes a static known table to be referred to in the tbl_baptismone with the parish id. if this is the case all you need is one insert query.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Ian,

    With over 1400 records in your sample, have you identified the logic to take you from your raw data to your expected/desired output?

    Do you have a plan to deal with no Birth year, no forename, no FicheNo... etc?

    Forename with extra data
    eg
    Tamar (privately baptised 04 Jul 1802, received into church this day)
    It seems to me there are a number of steps involved before final code.
    Some decisions/trials for transformation; some testing to show/prove/disprove viability of the option etc.

    Just some thoughts for consideration.
    Good luck.

  6. #6
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    Hi

    thanks for the thoughts.

    Yes I have ghosted out "The front end" and the only data that will be searched for in reality is either the year of baptism or the surname. All other information is needed or may be needed if the record is used in research. The exisiting users simply load up each spreadsheet in turn and search the year colum for say 1654 and then look at those records.

    As to the records with no no Birth year, no forename, no FicheNo. they are as was entered in the register and to a researcher it's non apearance is informative.

    However later parish records contain more data.

    I have ghosted up a crude front end and shown it to the committee ( yep I'm dealing with a committee of volunteers) and they approve the concept.

    All that being said back to my original question which I may have confused every one and my self ;-)

    I want to split the spreadsheet over two tables so that the parish is in one table and the entries are in the other.

    I can run two append queries to populate the two tables but an at a loss as to how to setup the foreign key in the Baptism table. I do appreciate that at the moment the parish table contains only one parish Westbury but I have 54 to import into the database.

    I wondered it there was a way to run an update query to populate two tables and create the refererntial integrity

    Hope thats clear

    cheers

    Ian

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Ian,
    Re: ghosted up a crude front end

    Here's a link that I have recommended to others re: the approach to getting tables and rules aligned/matching the business needs. It's one I have used many times. It may be helpful, if only as a reference to help put things into context.

    Good luck.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 09-02-2015, 08:44 AM
  2. Access can't append all the records in the append query
    By fluffyvampirekitten in forum Access
    Replies: 2
    Last Post: 08-27-2015, 01:53 AM
  3. Replies: 1
    Last Post: 10-06-2011, 08:37 AM
  4. Replies: 7
    Last Post: 07-21-2011, 01:01 PM
  5. Append query won't append
    By yelkenli in forum Queries
    Replies: 5
    Last Post: 02-12-2010, 11:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums