Hi,
I am desparately trying to find some help with this. It seems as if it should be simple.
I have a main form that displays customers. It has a subform displaying related records. The subform has a combo box which is used to filter the subform records.
The combo box (named Cat_Search) is tied simply to a value list that provides three values:
Common
Security
Other
The subform has a [Category] field that stores one of these values for each of its records.
When a user selects one of the values (above), the subform should filter to display only those matching records. The [Cat_Search] box exists on the subform which it is filtering. The subform is in a tab control.
The only code I have is on [Cat_Search]:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_Available_list"
stLinkCriteria = "[category]=" & "'" & Me![Cat_Search] & "'"
DoCmd.ApplyFilter stDocName, stLinkCriteria
The code works fine if I open the subform by itself, but when it is placed within another form it doesn't. The problem appears to be in the "stlinkcriteria" line. Should it be rewritten?
Can anyone help?
I am desparately trying to find some help with this. It seems as if it should be simple.
I have a main form that displays customers. It has a subform displaying related records. The subform has a combo box which is used to filter the subform records.
The combo box (named Cat_Search) is tied simply to a value list that provides three values:
Common
Security
Other
The subform has a [Category] field that stores one of these values for each of its records.
When a user selects one of the values (above), the subform should filter to display only those matching records. The [Cat_Search] box exists on the subform which it is filtering. The subform is in a tab control.
The only code I have is on [Cat_Search]:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_Available_list"
stLinkCriteria = "[category]=" & "'" & Me![Cat_Search] & "'"
DoCmd.ApplyFilter stDocName, stLinkCriteria
The code works fine if I open the subform by itself, but when it is placed within another form it doesn't. The problem appears to be in the "stlinkcriteria" line. Should it be rewritten?
Can anyone help?