requery subform

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • calebm12
    New Member
    • Mar 2006
    • 5

    #1

    requery subform

    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.Ite msSelected
    strWhere = strWhere & Me.MemberID.Ite mData(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 "subfrmindividu al",,strwhere
    and i get errors.
    can anyone help....please!
    caleb
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    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.Val ue

    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.


    Originally posted by calebm12
    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.Ite msSelected
    strWhere = strWhere & Me.MemberID.Ite mData(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 "subfrmindividu al",,strwhere
    and i get errors.
    can anyone help....please!
    caleb

    Comment

    Working...