By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,483 Members | 1,506 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,483 IT Pros & Developers. It's quick & easy.

requery subform

P: 5
Previously i had a combo box where i could select a name and then click a button and a subform on that form would requery and give me the information i wanted.
However, i have now changed the combo box to a list box...and am having a difficult time integrating the requery feature.
in short i have

strWhere = "[memberID] = "
For Each varItem In Me.MemberID.ItemsSelected
strWhere = strWhere & Me.MemberID.ItemData(varItem) & " OR [memberID] = "
Next varItem
strWhere = Left(strWhere, Len(strWhere) - 17)

i now how to write the next line if i was sending this info to a report. however, i have not been able to figure out how to make a command that will requery the subform.
i have tried docmd.requery "subfrmindividual",,strwhere
and i get errors.
can anyone help....please!
caleb
Aug 24 '06 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
The code you are using is the code used to run through selections in a multi select listbox. Try this as your link criteria:

strWhere = "[MemberID]=" & Me.MemberID.Value

This assumes MemberID is the name of your dropdown box and the bound column of your dropdown box.

By the way this will only result in one members records appearing in the subform as you can't multi select a drop down box.


Previously i had a combo box where i could select a name and then click a button and a subform on that form would requery and give me the information i wanted.
However, i have now changed the combo box to a list box...and am having a difficult time integrating the requery feature.
in short i have

strWhere = "[memberID] = "
For Each varItem In Me.MemberID.ItemsSelected
strWhere = strWhere & Me.MemberID.ItemData(varItem) & " OR [memberID] = "
Next varItem
strWhere = Left(strWhere, Len(strWhere) - 17)

i now how to write the next line if i was sending this info to a report. however, i have not been able to figure out how to make a command that will requery the subform.
i have tried docmd.requery "subfrmindividual",,strwhere
and i get errors.
can anyone help....please!
caleb
Aug 24 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.