Results 1 to 4 of 4
  1. #1
    rosefield is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    9

    Filling in fields in a form from fields in same table.

    I am working on a pedigree form and in the table I have information on sire and dam, which they are also animals in the database. What I am trying to do is when it comes to filling in the fields for the sire or dam that I can look up the animals name and then be able to auto-fill in the sys-id, code, name, reg number fields from what ever animal is selected.

    I have seen where this can be done from separate tables but not from the same table.



    Thanks,

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664

  3. #3
    rosefield is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    9
    After hours of searching and trying I finally found and figured out how to do it.

    First, I had to make the field on the form to be a combo box, then I selected to get the value from a table or query. I have 2 queries, one that sorts out the females and one that sorts out the males. I selected the fields that I needed and set my query.

    Then on the same field I went to the event tab on the properties sheet and on the "on change", I selected [event procedure] and then set up a procedure to take columns from the query to fill in fields on the form.

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Glad you figured it out

    I would have used the after update event. I don't think the on change event is doing what you think.... but if it works, what do I know???


    The change event fires every time you press a key. So if you try typing a "Sire" name, say "Seattle Slew", the change event fires 12 times.
    Try this. Ensure the form header is displayed. Enter this line in the change event for the combo box"
    Code:
    Me.FormHeader.BackColor = Not (Me.FormHeader.BackColor)
    Then type in a "Sire" or "Dam" name.

    If you never use autocomplete and only select names using the list, never mind.
    And if I didn't understand, ignore the above.

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

Similar Threads

  1. Replies: 1
    Last Post: 08-15-2015, 01:30 AM
  2. Replies: 3
    Last Post: 07-24-2014, 01:22 PM
  3. Replies: 6
    Last Post: 09-22-2013, 09:52 PM
  4. Replies: 5
    Last Post: 12-19-2012, 07:26 PM
  5. Auto filling form fields
    By adamch29 in forum Forms
    Replies: 1
    Last Post: 07-25-2007, 06:22 PM

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