Hello everyone,
need your urgent help...
A standard form based on simple query displays a current record. On the same form there is a combobox that displays all records in a query.
I add the test code to BeforeUpdate event of combobox:
Private Sub cmboxProdList_BeforeUpdate(Cancel As Integer)
Dim strPName As String
strPName = Forms!frmProductAuthorize!cmboxProdList.Column(1)
MsgBox (strPName)
End Sub
Works perfectly! Every time I select another line in combobox I see message with appropriate strPName - value of column 1 of combobox.
Now I'm trying to filter the form to display the record filtered by value selected in combobox...
Private Sub cmboxProdList_BeforeUpdate(Cancel As Integer)
Dim strPName As String
strPName = Forms!frmProductAuthorize!cmboxProdList.Column(1)
If IsLoaded("frmProductAuthorize") Then
Forms!frmProductAuthorize.Filter = "[Product Name] = strPName"
Forms!frmProductAuthorize.FilterOn = True
End If
End Sub
... I receive run-time error 2115... I've checked alike threads on this forum, but still didn't understand what's wrong with my filtering...
Thanks a lot for any help you can provide
need your urgent help...
A standard form based on simple query displays a current record. On the same form there is a combobox that displays all records in a query.
I add the test code to BeforeUpdate event of combobox:
Private Sub cmboxProdList_BeforeUpdate(Cancel As Integer)
Dim strPName As String
strPName = Forms!frmProductAuthorize!cmboxProdList.Column(1)
MsgBox (strPName)
End Sub
Works perfectly! Every time I select another line in combobox I see message with appropriate strPName - value of column 1 of combobox.
Now I'm trying to filter the form to display the record filtered by value selected in combobox...
Private Sub cmboxProdList_BeforeUpdate(Cancel As Integer)
Dim strPName As String
strPName = Forms!frmProductAuthorize!cmboxProdList.Column(1)
If IsLoaded("frmProductAuthorize") Then
Forms!frmProductAuthorize.Filter = "[Product Name] = strPName"
Forms!frmProductAuthorize.FilterOn = True
End If
End Sub
... I receive run-time error 2115... I've checked alike threads on this forum, but still didn't understand what's wrong with my filtering...
Thanks a lot for any help you can provide