|
-
Nov 11th, 2008, 03:18 PM
#1
Thread Starter
Hyperactive Member
[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
-
Nov 11th, 2008, 04:22 PM
#2
Fanatic Member
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.
-
Nov 11th, 2008, 04:30 PM
#3
Thread Starter
Hyperactive Member
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.
-
Nov 11th, 2008, 04:36 PM
#4
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|