Hello everyone,
I have researched and tried just about all I can on this subject, but I understand my situation is different since I am working on ADP file, using Access on the front end and SQL Server on the back end. The biggest problem is that my query designs are not as sophisticated as they are in normal Access versions. I still think I can make this work however... just need some specific help.
If anyone has a little bit of time on their hands, I would be in your debt if you can help me figure out this request.
I am trying to filter just 1 field on a subform by having the user type a value in a text box control on the main form. My subform has text type fields, and the one I would like to filter is named "Semester".
I realize I must use an Unbound text box which I have named "txtFilterSemester", but I cannot figure out the VBA for this process.
The subform is using a query (view) as its record source and this query (view) is pulling records from 3 tables. The subform is named "AU_subform". The query is named "Agency_University_Results" and the main form itself is named "AU_Graduates". Please Help!!!!
Here is the unsuccesful code I have tried recently:
Private Sub txtFilterSemester_Change()
Dim strWhere As String
With Me.txtFilterSemester
If .Text = vbNullString Then
strWhere = "(False)"
Else
strWhere = "[Semester] Like """ & .Text & "*"""
End If
End With
With Me.[AU_subform].Form
.Filter = strWhere
.FilterOn = True
End With
End Sub
When I try to type in the text box, the subform goes blank and doesn't do anything.
I have researched and tried just about all I can on this subject, but I understand my situation is different since I am working on ADP file, using Access on the front end and SQL Server on the back end. The biggest problem is that my query designs are not as sophisticated as they are in normal Access versions. I still think I can make this work however... just need some specific help.
If anyone has a little bit of time on their hands, I would be in your debt if you can help me figure out this request.
I am trying to filter just 1 field on a subform by having the user type a value in a text box control on the main form. My subform has text type fields, and the one I would like to filter is named "Semester".
I realize I must use an Unbound text box which I have named "txtFilterSemester", but I cannot figure out the VBA for this process.
The subform is using a query (view) as its record source and this query (view) is pulling records from 3 tables. The subform is named "AU_subform". The query is named "Agency_University_Results" and the main form itself is named "AU_Graduates". Please Help!!!!

Here is the unsuccesful code I have tried recently:
Private Sub txtFilterSemester_Change()
Dim strWhere As String
With Me.txtFilterSemester
If .Text = vbNullString Then
strWhere = "(False)"
Else
strWhere = "[Semester] Like """ & .Text & "*"""
End If
End With
With Me.[AU_subform].Form
.Filter = strWhere
.FilterOn = True
End With
End Sub
When I try to type in the text box, the subform goes blank and doesn't do anything.