G
Guest
Hi there,
I have a search form and a text box on it into which the user will type the
item they want to filter on. I have a main form with a subform and I want
the form to open filtering the subform's records based on what is typed into
form search.
On my main form, I have based it on the same query as the subform but am not
displaying any of the fields. One of these is called "Vendor" and I have
tried the following:
If IsOpen("frmSearch") Then
Me.frmExpenses_sub.Filter = Me.Vendor
Me.frmExpenses_sub.FilterOn = True
End If
The click event of the appropriate button on the search form has the
following code:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmExpenses"
stLinkCriteria = "[strVendor]like" & "'*" & Me![txtExpVend] & "*'"
'wildcard search
DoCmd.OpenForm stDocName, , , stLinkCriteria
This works fine and when I make the "Vendor" field visible shows the correct
info but I would like to pass this onto my subform. What am I doing wrong?
Thanks for any help offered!
JR
I have a search form and a text box on it into which the user will type the
item they want to filter on. I have a main form with a subform and I want
the form to open filtering the subform's records based on what is typed into
form search.
On my main form, I have based it on the same query as the subform but am not
displaying any of the fields. One of these is called "Vendor" and I have
tried the following:
If IsOpen("frmSearch") Then
Me.frmExpenses_sub.Filter = Me.Vendor
Me.frmExpenses_sub.FilterOn = True
End If
The click event of the appropriate button on the search form has the
following code:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmExpenses"
stLinkCriteria = "[strVendor]like" & "'*" & Me![txtExpVend] & "*'"
'wildcard search
DoCmd.OpenForm stDocName, , , stLinkCriteria
This works fine and when I make the "Vendor" field visible shows the correct
info but I would like to pass this onto my subform. What am I doing wrong?
Thanks for any help offered!
JR