Kumar-
You don't show the rest of your code, so it's hard to see how you're trying to apply the filter.
BUT you are constructing the filter incorrectly. A filter must always reference just the field name:
SESNum LIKE "<some search>"
Or
SESNum = "<some search>"
It doesn't look like you are adding any wildcards (*), so you probably should be using equals.
After you get the filter built, and as long as the filter isn't referencing any fields on the outer form, you should do:
Me.child59.Form.Filter = strWhere
Me.child69.Form.FilterOn = True
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
(Paris, France)
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of access_kri@yahoo.com
Sent: Monday, December 02, 2013 6:46 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Search data of subform from Main Form
Dear group,
I have search combo boxes in the main form header to search and filter data contained in the main form fields. The main form also contains sub-form and I am not able to construct a search string to search for data contained in the subform. Require help for the same.
I tried with the following code but it is throwing up some error and not filtering the sub-form
If Not IsNull(Me.cboSearchSEnum) Then
strWhere = strWhere & "(Me.child59.SESNum Like """ & Me.[cboSearchSEnum] & """) AND "
End If
Child 59 is the subform name and SESNum is the field in the sub-form which I am trying to find, cboSearchSENum is the search combo box on the main form header which lists the SESnumbers of the Subform.
Regards,
Kumar
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar