Results 1 to 4 of 4

Thread: [ACCESS] List Item values based on Current Form Data

  1. #1

    Thread Starter
    Hyperactive Member NPassero's Avatar
    Join Date
    May 2007
    Location
    NJ
    Posts
    272

    [ACCESS] List Item values based on Current Form Data

    I have a List Box on my form in Access, and I want to update the list items based on a query and based on the values of the current record.

    in essence the query would be:
    Code:
    SELECT GroupName from GroupMembersWHERE GroupMembers.ContactID = Form!Contacts.ContactID
    I would assume that this goes in the AfterUpdate event? but I am very unfamiliar with VB Script and also Access programming and am not sure how to fill the item list

  2. #2
    Fanatic Member dmaruca's Avatar
    Join Date
    May 2006
    Location
    Jacksonville, FL
    Posts
    577

    Re: [ACCESS] List Item values based on Current Form Data

    You'd place your SQL in the rowsource property and change rowsource type to Table/Query.

  3. #3

    Thread Starter
    Hyperactive Member NPassero's Avatar
    Join Date
    May 2007
    Location
    NJ
    Posts
    272

    Re: [ACCESS] List Item values based on Current Form Data

    I have done that, and when it first loads, the query works fine.. When I am changing form entries, it stays with the first record's value and does not update the list.

  4. #4
    Fanatic Member dmaruca's Avatar
    Join Date
    May 2006
    Location
    Jacksonville, FL
    Posts
    577

    Re: [ACCESS] List Item values based on Current Form Data

    I'm not sure how you are set up, but you could use the ContactID afterupdate event. Set it to event procedure, click the elipsis, and make it something like this:

    Code:
    Private Sub ContactID_AfterUpdate()
        listboxName.Requery
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width