Results 1 to 2 of 2
  1. #1
    aray213 is offline Novice
    Windows XP Access 2010 (version 14.0)
    Join Date
    Sep 2010
    Posts
    1

    Create New table entries when new record created, Any Version

    I have two tables (tblzipcodes, and tbluwguidelines)that have a relationship via a common field name (UWID). I have another table (tblcountyandzip) that containes all of the zip codes and corresponding counties.



    What I am trying to do is if a new entry is created in tbluwguidelines (new UWID) and that entry does not have all of the current zip codes (from tblcountyandzip) assigned to it in tblzipcodes (matching UWID) that the zipcodes (new entry)will be created in tblzipcodes.

    So basically after a new entry is created in tbluwguidelines all of the coresponding zip codes will also be created in tblzipcodes.

    UWID is the primary key in tbluwguidelines and tblzipcodes has its own primary id (zipid)

    I know this is not 100% detail of what I am trying to accomplish but I am not sure what else would need to be described.

    I guess a better explanation might be that if a new record is created in tbluwguidelines then I need to check and see if the entries in tblzipcode have every zip code from tblcountyandzip for the new entry (UWID) and if not create a new entry in tblzipcode for each zipcode not in the table already.

    The fields in tblcountyandzip are:
    zipcode
    county

    the fields in tblzipcodes are :
    zipid
    companyid (combo box lookup from another table)
    zipcode
    county
    open
    UWID

    the fields in tbluwguidelines are:
    UWID
    as well as several others that have no relevance.

    So if a new entry into tbluwguidelines is created what i am trying to accomplish is to create new entries in tblzipcodes for each zipcode in tblcountyandzip where
    zipid is primary key and created automatically
    companyid is assigned from the form
    zipcode is entered from tblcountyandzip (each entry (zipcode) in this table would be a new zipid)
    county is copied from tblcountyandzip
    open is just a simple yes/no defaulted to no
    UWID is from the newly created record in tbluwguidelines

    Thanks in advance for any help.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    I would stick to this version: http://www.access-programmers.co.uk/...d.php?t=199224

    Chances of getting a lot of eyes on the problem is much better there.

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

Similar Threads

  1. merge multiple entries in table
    By rajsa in forum Database Design
    Replies: 1
    Last Post: 07-02-2010, 07:16 AM
  2. Create a variable from a query created in VBA
    By kaelcarp in forum Programming
    Replies: 4
    Last Post: 06-11-2010, 09:13 PM
  3. Inport Table from Chinese to English version
    By PatrickC. in forum Access
    Replies: 0
    Last Post: 04-07-2010, 10:19 PM
  4. Create PDF for each record in table/form
    By ChrisCMU in forum Forms
    Replies: 15
    Last Post: 07-28-2009, 01:52 PM
  5. Importing a table created in word to Access
    By anthony_f_justin in forum Access
    Replies: 4
    Last Post: 01-04-2006, 09:06 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