Results 1 to 9 of 9
  1. #1
    Atoga is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    21

    populate data in listbox based on textbox value chang

    Hi All,
    I am setting up data entry forms. I would like to populate data in listboxes based on change in textbox value. So for example when I have a course in the textbox in my data entry form (control source is the course list) I can see the list of participants of that course appearing in the list box under the text box.


    I am quite new to Access. Could someone help me with this?
    Cheers

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    This is dependent (cascading) list or combo boxes. Review http://www.datapigtechnologies.com/f...combobox2.html

    Be aware this will not work nice with continuous or datasheet forms.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Atoga is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    21
    Thanks June7,
    What if my listbox is dependent on a textbox?
    I added the Where criteria to the listbox, the content of the listbox shows up correctly (i.e. according to what I have in the textbox) when I run the query (row source Select Qry), but it does not show up correctly in the listbox in the form itself. I added a Requery macro AfterUpdate (textbox), but it still does not work...what do you think the problem is? Thanks

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Doesn't matter if first control is textbox or combobox or listbox, technique is the same.

    I don't use macros, only VBA.

    I don't know why it doesn't work. Would have to know more about data structure, form setup, listbox properties. If you want to provide db, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    accedeholdings is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Sep 2014
    Location
    Hackney, South Australia
    Posts
    17
    I agree with June, working with macros sometimes mess up the database. I'd rather do it manually than using macros.

  6. #6
    Atoga is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    21

    populate data in listbx based on textbx value change

    Hi June7 and accedeholdings,
    Pls find it attached.
    Cheers
    Attached Files Attached Files

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    A few things to consider:

    Use a naming convention that is alphanumeric and "_" underscore only. No \& etc.
    In your junction table, you only need the ID fields from the related tables. I'd suggest a unique compound index as shown to prevent duplicates.

    Here is a list of reserved words in Access.
    Attached Thumbnails Attached Thumbnails junction.jpg  

  8. #8
    Atoga is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    21
    Thanks, I made the changes. However, this still have not solved my issue of the Skills listbox on the Dataentry form not updating when I move between records of Course/Qualification (see above, at the beginning of the thread). Can you please help me with this?

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    The query references a textbox or field named Course/QualifID. This is a field referencing itself for its criteria. The query needs to reference the textbox on the form which is named Course/Qual.

    Why isn't Course/Qualification a combobox instead of textbox?

    The VBA procedure is not associated with the textbox. The textbox event has an Embedded Macro which opens QrySkillList.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Using a Listbox to populate a Textbox.
    By IncidentalProgrammer in forum Forms
    Replies: 7
    Last Post: 10-29-2014, 12:32 PM
  2. Replies: 2
    Last Post: 08-21-2013, 09:39 AM
  3. Replies: 10
    Last Post: 06-18-2013, 02:00 PM
  4. Unable to populate textbox based on listbox
    By marcustofeles in forum Forms
    Replies: 21
    Last Post: 10-24-2011, 07:18 AM
  5. Replies: 3
    Last Post: 08-25-2010, 09:03 AM

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