Results 1 to 8 of 8
  1. #1
    nejenkins is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2015
    Posts
    14

    Auto fill a name

    I have a table of basic information.
    I have a related table linked by a unique number.
    When I create a field in the related table, I start by inserting the unique number. Can i then ask it to autoinsert the persons name (a field in the primary table) automatically in a field?

  2. #2
    Gina Maylone is offline Always learning
    Windows 7 64bit Access 2013
    Join Date
    Jun 2013
    Location
    Afton, MN
    Posts
    544
    Are you using a form to add data?

  3. #3
    nejenkins is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2015
    Posts
    14
    sometimes but not always. i presume it matters

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    if you are talking about storing the information in two different tables, don't.

    For instance if you have the tables

    Code:
    tblCustomer
    C_ID  C_Name ---> other customer fields
    1     Acme Explosives
    2     Acme Rockets
    
    tblOrders
    O_ID  C_ID  O_Date ---> other order fields
    1     1     1/1/2016
    You do not want to store the customer name on the orders field, you would just be storing extraneous data for no added benefit. You can perform the lookup on a form either by using a combo box (the preferred and easier method) or using a lookup query. Assuming you have your primary keys set up correctly it's possible for you to put in a customer number and have the customer name populated in another field.

  5. #5
    nejenkins is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2015
    Posts
    14
    Correct. I dont need it to be stored in both tables/forms but when I enter the number into the related table/form Id like the name to come up both as a safety check that Ive entered the correct number but so as an identifier to me when i browse the table/form

    can you explain how to add a 'combo box' to the form

    n



    Quote Originally Posted by rpeare View Post
    if you are talking about storing the information in two different tables, don't.

    For instance if you have the tables

    Code:
    tblCustomer
    C_ID  C_Name ---> other customer fields
    1     Acme Explosives
    2     Acme Rockets
    
    tblOrders
    O_ID  C_ID  O_Date ---> other order fields
    1     1     1/1/2016
    You do not want to store the customer name on the orders field, you would just be storing extraneous data for no added benefit. You can perform the lookup on a form either by using a combo box (the preferred and easier method) or using a lookup query. Assuming you have your primary keys set up correctly it's possible for you to put in a customer number and have the customer name populated in another field.

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    If you already have a text box on your form, just right click on it, you should get a right click context menu. In that option list you should be able to 'change to..' a combo box. Then just use the properties window to change the column widths to 0,1 and make the query driving the combo box look up the primary key field and the description field of your customers (or whatever it is). If you do it properly you should be able to choose your customer by name, rather than number if that's your preferred way.

  7. #7
    nejenkins is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2015
    Posts
    14
    it is asking me to delete the relationship between the tables to allow the edit - is this safe? can i just reinstate the relationship afterwards?

  8. #8
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    you do not need relationships for your form to work, in fact, defined relationships often limit what you can do rather than enhance what you can do, I don't ever set up relationships in my databases.

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

Similar Threads

  1. Auto fill help
    By Ternick in forum Access
    Replies: 5
    Last Post: 11-12-2015, 07:21 AM
  2. auto-fill help
    By stephenchan433 in forum Forms
    Replies: 3
    Last Post: 11-09-2015, 08:09 AM
  3. Auto Fill
    By Derrick T. Davidson in forum Forms
    Replies: 4
    Last Post: 07-12-2014, 08:19 AM
  4. Auto Fill
    By Scotty J in forum Forms
    Replies: 10
    Last Post: 11-21-2011, 10:08 AM
  5. Auto Fill
    By Phoenyxsgirl in forum Forms
    Replies: 28
    Last Post: 10-12-2011, 05:48 PM

Tags for this Thread

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