Can someone help me on this code. When I click Submit it pulls all records into my Subform. It doesn't seem to see the value I select from my combox on my main form.
Thanks for you help!
Private Sub FindSearch_Click()
Dim strWhere As String
strWhere = "1=1"
' If ReferredBy
If Nz(Me.ReferredBy) <> "" Then
'Add the predicate
strWhere = strWhere & " AND " & "Contacts.[Referred By] = '" & Me.ReferredBy & "'"
End If
'DoCmd.OpenForm "Browse Contacts", acFormDS, , strWhere, acFormEdit, acWindowNormal
If Not Me.FormFooter.Visible Then
Me.FormFooter.Visible = True
DoCmd.MoveSize Height:=Me.WindowHeight + Me.FormFooter.Height
Else
Me.Browse_All_Contacts.Form.Filter = strWhere
Me.Browse_All_Contacts.Form.FilterOn = True
End If
End Sub
Thanks for you help!
Private Sub FindSearch_Click()
Dim strWhere As String
strWhere = "1=1"
' If ReferredBy
If Nz(Me.ReferredBy) <> "" Then
'Add the predicate
strWhere = strWhere & " AND " & "Contacts.[Referred By] = '" & Me.ReferredBy & "'"
End If
'DoCmd.OpenForm "Browse Contacts", acFormDS, , strWhere, acFormEdit, acWindowNormal
If Not Me.FormFooter.Visible Then
Me.FormFooter.Visible = True
DoCmd.MoveSize Height:=Me.WindowHeight + Me.FormFooter.Height
Else
Me.Browse_All_Contacts.Form.Filter = strWhere
Me.Browse_All_Contacts.Form.FilterOn = True
End If
End Sub