G
Guest
Hello Sirs
I currently have a form with numerous fields:
CboName, CboRegion, CboCategory, TxtIns
All of these fields i've placed bound on a form (linked to the main table).
I designed an additional interface (form) for all of the drop-down boxes, that should somehow allow the user to search/filter by the different criteria in the drop-downs and texts field to help search the table and appear filtered/search on the bound form
Basically I don't know the code to search whatever fields are contained in the unbound search form and to filter the bound form based on the criteria in that unbound form.
I tried doing some outlandish code enclosed below
__________________beginning of my code_____
Private Sub CmdOK_Click(
On Error GoTo Err_CmdOK_Clic
Dim strSQL As Strin
strSQL = "
If Len(Me.CmbFilter & vbNullString) = 0 The
MsgBox "Please select one of the options.", vbInformation, "Selection Required
ElseIf Me.CmbFilter = "See All" The
DoCmd.OpenForm "Web Status Clients Form Test New Filter
DoCmd.Close acForm, "Web Status Clients Search Form w Filters
ElseIf Me.CmbFilter = "Filter By.." The
If IsNull(Me!CmbRegions) = False The
If Len(strSQL) = 0 The
strSQL = strSQL & "Region = '" & Me.CmbRegions & "'
Els
strSQL = strSQL & " AND Region = '" & Me.CmbRegions & "'
End I
End I
DoCmd.OpenForm "Web Status Clients Form Test New Filter", acNormal, strSQ
DoCmd.Close acForm, "Web Status Clients Search Form w Filters
End I
Exit_CmdOK_Click
Exit Su
Err_CmdOK_Click
MsgBox Err.Descriptio
Resume Exit_CmdOK_Clic
End Su
______
But this does not filter the form for me at all. Any help
Hope this makes it easier to understand what I am trying to accomplish
With respect
Sñr. Alfonzo Edgard
PS Get Dirk on the job...he's Primo
I currently have a form with numerous fields:
CboName, CboRegion, CboCategory, TxtIns
All of these fields i've placed bound on a form (linked to the main table).
I designed an additional interface (form) for all of the drop-down boxes, that should somehow allow the user to search/filter by the different criteria in the drop-downs and texts field to help search the table and appear filtered/search on the bound form
Basically I don't know the code to search whatever fields are contained in the unbound search form and to filter the bound form based on the criteria in that unbound form.
I tried doing some outlandish code enclosed below
__________________beginning of my code_____
Private Sub CmdOK_Click(
On Error GoTo Err_CmdOK_Clic
Dim strSQL As Strin
strSQL = "
If Len(Me.CmbFilter & vbNullString) = 0 The
MsgBox "Please select one of the options.", vbInformation, "Selection Required
ElseIf Me.CmbFilter = "See All" The
DoCmd.OpenForm "Web Status Clients Form Test New Filter
DoCmd.Close acForm, "Web Status Clients Search Form w Filters
ElseIf Me.CmbFilter = "Filter By.." The
If IsNull(Me!CmbRegions) = False The
If Len(strSQL) = 0 The
strSQL = strSQL & "Region = '" & Me.CmbRegions & "'
Els
strSQL = strSQL & " AND Region = '" & Me.CmbRegions & "'
End I
End I
DoCmd.OpenForm "Web Status Clients Form Test New Filter", acNormal, strSQ
DoCmd.Close acForm, "Web Status Clients Search Form w Filters
End I
Exit_CmdOK_Click
Exit Su
Err_CmdOK_Click
MsgBox Err.Descriptio
Resume Exit_CmdOK_Clic
End Su
______
But this does not filter the form for me at all. Any help
Hope this makes it easier to understand what I am trying to accomplish
With respect
Sñr. Alfonzo Edgard
PS Get Dirk on the job...he's Primo