Filtering a form from another form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DAF LAD
    New Member
    • Oct 2006
    • 8

    Filtering a form from another form

    Hi all,

    I currently have a database that has a form for input, I have created another form that looks identical to this one looking at the same data in the same tables however only one thing is selectable/changeable as this is a "review form"

    I would like to create a form for users to use to select a date from a list that then (by pressing a command button) takes the seltected date and filters the review form by this date.

    Can anyone tell me if this is possible and if so how to do it. I have tried many different things so far and nothing seems to work.

    Thanks in advance
  • hyperpau
    Recognized Expert New Member
    • Jun 2007
    • 184

    #2
    let's assume your Input Form is named frmInput and your Review Form is named frmReview.

    Then now let's name your Combo box (if i got that right) for the dates as cboDate and your command button named as cmdFilter.

    In the frmReview Form is a field named txtDate

    Now what user will do is to select a date from the cboDate in the frmInput, then click cmdFilter button and it will open frmReview with only records that has the txtDate field matching the date selected by the user in the cboDate from the frmInput.

    if I got this right, then you just have to program your cmdFilter to open the form and put a WHERE condition.


    Code:
    Private Sub cmdFilter_Click()
    Docmd.OpenForm "frmReview", , , txtDate = "Me!cboDate"
    End Sub

    The only thing I am not really sure for I don't have MS Access in my PC right now is the actual number of comma (,) inbetween so try adding one or removing one and see which works.

    Comment

    Working...