Based on your description, I'm guessing you have a combo of drop-downs and
text boxes on a lookup form and a command button. To do what you want to
accomplish, you need to use VBA code and it is not too difficult.
Below is a sub that is called when the command button, cmdOK, is clicked.
You can modify this code to fit your needs. If you need more specific help,
post back with your relevant code and questions.
Private Sub cmdOK_Click()
Dim strRep As String
Dim strTitle As String
Dim strFilter As String
'Populate the rep lookup
'
If IsNull(Me.cboRepList.Value) Then
strRep = "Like '*'"
Else
strRep = "=" & Me.cboRepList.Value
End If
'Populate the title lookup
'
If IsNull(Me.txtTitle.Value) Then
strTitle = "Like '*'"
Else
strTitle = "='" & Me.txtTitle.Value & "'"
End If
'Populate the where clause
'
strFilter = "[RepID] " & strRep & " AND [Title] " & strTitle
Debug.Print strFilter
DoCmd.OpenForm "REP_LIST_REF_F", acNormal, , strFilter, acFormEdit,
acWindowNormal
DoCmd.Close acForm, "REP_LOOKUP_F", acSaveNo
End Sub
"Tom Wildy" wrote:
> I have a form that selects a project, financial year and repoarting qurter
> and then opens a form showing a project and its outputs. I can't get the
> form to pick up the project from the first form.
>
> Do I create variables and pass themn as in conventional programing, or what?
>
> YOurs
>
> Tom
|