G
Guest
I have a form used as a filter form with the following code
Private Sub CmdOK_Click(
On Error GoTo Err_CmdOK_Clic
Dim strWhere As Strin
Dim strLink As Strin
If Len(Me.CmbFilter & vbNullString) = 0 The
MsgBox "Please select one of the options.", vbInformation, "Selection Required
CmbFilter.SetFocu
ElseIf Me.CmbFilter = "See All" The
DoCmd.OpenForm "Web Status Clients Form
DoCmd.Close acForm, "Web Status Clients Search Form
ElseIf Me.CmbFilter = "Filter By.." The
If Not IsNull(Me.CmbRegions) And CmbRegions.Value <> "All" The
strWhere = strWhere & strLink & "[Regions]=""" & CmbRegions & """
strLink = " And
If Me.CmbRegions.Value = All The
strWhere = strWhere & strLin
strLink = " And
End I
End I
If Not IsNull(Me.CmbActivity) And CmbActivity.Value <> "All" The
strWhere = strWhere & strLink & "[Activity Ranking]=""" & CmbActivity & """
strLink = " And
If Me.CmbActivity.Value = "All" The
strWhere = strWhere & strLin
strLink = " And
End I
End I
If Not IsNull(Me.TxtContactLName) And TxtContactLName.Value <> "All" The
strWhere = strWhere & strLink & "[Last Name]Like """ & "*" & TxtContactLName & "*" & """
strLink = " And
If Me.TxtContactLName.Value = All The
strWhere = strWhere & strLin
strLink = " And
End I
End I
DoCmd.Minimiz
DoCmd.OpenForm "Web Status Clients Form", acNormal, , strWher
'DoCmd.Close acForm , "Web Status Clients Search Form
End I
Exit_CmdOK_Click
Exit Su
Err_CmdOK_Click
MsgBox Err.Descriptio
Resume Exit_CmdOK_Clic
End Su
The form "Web Status Clients Form" opens filtered perfectly..
Now on the "Web Status Clients Form", I have two drop-downs, one bound to a table and one unbound. The bound one is used for new entries into the form and the unbound one is used as a FindFirst search. This works fine too..
The problem is I can't get the drop-downs to filter just those records...the form based on the Record Navigation toolbar shows the filter is working, but I somehow need to get the drop-downs to only show those filtered records for various filter options that the user may use in the first form...Any help is greatly appreciated! If you require more info, please do post here...Thank you!
Private Sub CmdOK_Click(
On Error GoTo Err_CmdOK_Clic
Dim strWhere As Strin
Dim strLink As Strin
If Len(Me.CmbFilter & vbNullString) = 0 The
MsgBox "Please select one of the options.", vbInformation, "Selection Required
CmbFilter.SetFocu
ElseIf Me.CmbFilter = "See All" The
DoCmd.OpenForm "Web Status Clients Form
DoCmd.Close acForm, "Web Status Clients Search Form
ElseIf Me.CmbFilter = "Filter By.." The
If Not IsNull(Me.CmbRegions) And CmbRegions.Value <> "All" The
strWhere = strWhere & strLink & "[Regions]=""" & CmbRegions & """
strLink = " And
If Me.CmbRegions.Value = All The
strWhere = strWhere & strLin
strLink = " And
End I
End I
If Not IsNull(Me.CmbActivity) And CmbActivity.Value <> "All" The
strWhere = strWhere & strLink & "[Activity Ranking]=""" & CmbActivity & """
strLink = " And
If Me.CmbActivity.Value = "All" The
strWhere = strWhere & strLin
strLink = " And
End I
End I
If Not IsNull(Me.TxtContactLName) And TxtContactLName.Value <> "All" The
strWhere = strWhere & strLink & "[Last Name]Like """ & "*" & TxtContactLName & "*" & """
strLink = " And
If Me.TxtContactLName.Value = All The
strWhere = strWhere & strLin
strLink = " And
End I
End I
DoCmd.Minimiz
DoCmd.OpenForm "Web Status Clients Form", acNormal, , strWher
'DoCmd.Close acForm , "Web Status Clients Search Form
End I
Exit_CmdOK_Click
Exit Su
Err_CmdOK_Click
MsgBox Err.Descriptio
Resume Exit_CmdOK_Clic
End Su
The form "Web Status Clients Form" opens filtered perfectly..
Now on the "Web Status Clients Form", I have two drop-downs, one bound to a table and one unbound. The bound one is used for new entries into the form and the unbound one is used as a FindFirst search. This works fine too..
The problem is I can't get the drop-downs to filter just those records...the form based on the Record Navigation toolbar shows the filter is working, but I somehow need to get the drop-downs to only show those filtered records for various filter options that the user may use in the first form...Any help is greatly appreciated! If you require more info, please do post here...Thank you!