Hello guys,
Once again I hope you will help me as usually happen.
I have the following situation :
- one form and subform ( set to start and show all records - datasheet style)
- a textbox that filters the subform based on what is written in it ( more exactly matches what is written it it and filters the subform based on the Service field )
- one Option Group that succesfully filters the subform based on a hidden filed in the sunform ( where simple 1,2 and 3 are stored ).
All this works great separatly but i want to accomplish the following thing -
filter the subform based on a service written and after to be able to select an option group that will further more filter the records that appeared based on the textbox filter.
I've tried something in the afterupdate event of the option group but i get - [3075] Syntax error in query expression [Comments]="2" and [Service]=ze"' - this is one example
Below are the codes that i have behind each :
The code for the textbox:
So,any way how i could obtain what i want ?
Thank you for your answer and help.
Once again I hope you will help me as usually happen.
I have the following situation :
- one form and subform ( set to start and show all records - datasheet style)
- a textbox that filters the subform based on what is written in it ( more exactly matches what is written it it and filters the subform based on the Service field )
- one Option Group that succesfully filters the subform based on a hidden filed in the sunform ( where simple 1,2 and 3 are stored ).
All this works great separatly but i want to accomplish the following thing -
filter the subform based on a service written and after to be able to select an option group that will further more filter the records that appeared based on the textbox filter.
I've tried something in the afterupdate event of the option group but i get - [3075] Syntax error in query expression [Comments]="2" and [Service]=ze"' - this is one example
Below are the codes that i have behind each :
Code:
Private Sub Frame100_AfterUpdate()
Me.L2_FtGroup_Contacts_sub.Form.Filter = "[Service]= " & Forms!L2_FtGroup_Contacts.txtFilter.Value & Chr(34) & "And [Comment]= " & Chr(34) & Forms!L2_FtGroup_Contacts.Frame100 & Chr(34)
'''Me.L2_FtGroup_Contacts_sub.Form.Filter = "[Comment]= " & Chr(34) & Forms!L2_FtGroup_Contacts.Frame100 & Chr(34)
[B]- this alone works great, but shows all the records that have 1,2 or 3 and not only those that have the service mendioned in the textbox[/B]
Me.L2_FtGroup_Contacts_sub.Form.FilterOn = True
If L2_FtGroup_Contacts_sub.Form.Filter = "[Comment]= " & Chr(34) & "3" & Chr(34) Then
Me.L2_FtGroup_Contacts_sub.Form.FilterOn = False
End If
End Sub
The code for the textbox:
Code:
rivate Sub txtFilter_AfterUpdate()
Dim strWhere As String
With Me.txtFilter
If .Text = vbNullString Then
strWhere = ""
Else
strWhere = "[Service] Like ""*" & .Text & "*"""
End If
End With
With Me.[L2_FtGroup_Contacts_sub].Form
.Filter = strWhere
.FilterOn = True
End With
End Sub
So,any way how i could obtain what i want ?
Thank you for your answer and help.