Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Mar 2002
    Thanked 0 Times in 0 Posts

    Form Search/Query Question (2003)

    I have a form which uses the following query to populate the data...

    SELECT Projects.Project_ID, Projects.Project_Name, Projects.Project_Comments, Projects.Project_Year, Projects.Project_Cost, Projects.Project_Num, Projects.Phase, Projects.Condo_Num, Projects.TargetInstallDate, Projects.RevisedInstallDate, Projects.ActualInstallDate, Projects.Deferred FROM Projects WHERE (((Projects.Project_Num)=Forms![Search - Projects by Project Number]!Project_Num));

    Basically a user enters his/her search criteria in the search form and it pulls the data up in another form. Well, I have another search form that searches on different criteria, the Project_ID. I would like to pull up the same result form, but am not sure how to accomplish this. I had added another Where criteria, but it keeps prompting for the Project_Num form criteria...

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Form Search/Query Question (2003)

    Set the Record Source property of the form to the Projects table instead of to the query you now have.

    When you open the form from Search - Projects by Project Number, use code like this:

    Private Sub cmdOpenTheOtherForm_Click()
    DoCmd.OpenForm FormName:="NameOfTheOtherForm", WhereCondition:="Project_Num = " & Me.Project_Num
    End Sub

    Substitute the correct names.
    You can do the same from another form, with a different WhereCondition.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts