Where Condition help!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Celanese
    New Member
    • Dec 2009
    • 2

    Where Condition help!

    Is there anyway to open a form and have the WHERE condition change based on which subform the user was on? I currently do this with 3 different codes, and 3 different buttons, but i'd like to just have one. The only thing that's changing in the WHERE condition is the subform name.

    Private Sub cmdEdit_Click()

    DoCmd.OpenForm "frmEdit", acNormal, "", "[Task_ID]=[Forms]![frmTask_List]!
    [I NEED THIS PART TO CHANGE BASED ON WHICH SUBFORM THE USER WAS ON].[Form]![Task_ID]", , acNormal

    End Sub
  • Delerna
    Recognized Expert Top Contributor
    • Jan 2008
    • 1134

    #2
    You could have a hidden textbox on the main form and have each subform update that text box with the value needed by the query.

    Now you can connect the where condition to the textbox on the main form instead of the subforms

    Comment

    Working...