Results 1 to 4 of 4
  1. #1
    Lynn Cohen is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    30

    Form with list boxes won't populate underlying table

    I have a form called Adaptation Form in which Last Name and Course Number are entered.
    The user looks up Last Name using a listbox on the form, and looks up Course Number using a second listbox on the form.

    To use the form, the user looks up Last Name in the listbox, finds the ID number associated with the Last Name, and enters the ID number on the form. The form then autopopulates with the last name. The process for entering a Course Number is the same.



    This populates the query underlying the form, but not the table. All that gets populated in the table is the ID Number for Last Name and the ID number for Course Number.

    Novice here - not even sure where to begin to look to solve this. Any suggestions are appreciated.

    Thanks

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by Lynn Cohen View Post
    This populates the query underlying the form, but not the table. All that gets populated in the table is the ID Number for Last Name and the ID number for Course Number.
    I do not understand this statement. The query updates but not the table? Maybe your comboboxes show something like a name when you are viewing the form and the table gets the prime key for that record/name.

    I think most people would be satisfied and even happy with this result. What, in your table, is not getting updated? Are you trying to insert a name that is associated with the ID?

  3. #3
    Lynn Cohen is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    30
    What gets updated in the table is the ID number for Last Name and the ID number for Course Number. The fields that hold the Last Name itself, and the Course Number itself, don't update.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    The list box sounds as if it is updating a field in a table. If you use the wizard to create a listbox it will ask you which field you want to store the result in. It will only offer one option. It sounds like you are updating the ID or foreign key in a table.

    So now the question is, "Are you trying to update multiple fields within a given record using your list box"?

    If you used the wizard, I believe there is now a hidden macro that grabs the value and updates the field. You can try switching the bound column of your list box from 1 to 2, maybe. Your goal may seem simple and straight forward. However, there are some things that make a difference, that matter.

    You can easily add fields that will receive an update using VBA. If you are trying to update multiple fields, a couple lines of code will do the trick.

    It is generally a bad idea to add things such as the literal text of a name to a field. 99.99% of the time PK's and FK's are used. The exception would be in very large DB's where there are records being queried from users that only know the literal text. It is unlikely your goal is to index columns of text to speed up your queries.

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

Similar Threads

  1. Replies: 11
    Last Post: 01-25-2013, 12:03 PM
  2. Form not updating underlying table
    By Kirsti in forum Forms
    Replies: 8
    Last Post: 02-10-2012, 12:23 AM
  3. Replies: 10
    Last Post: 10-10-2011, 08:08 PM
  4. Replies: 0
    Last Post: 12-02-2010, 11:59 AM
  5. List box to populate other list boxes
    By Nathan in forum Forms
    Replies: 0
    Last Post: 03-03-2009, 07: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