[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
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.
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.
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