I have your typically form/subform. You enter the account number in a
textbox and select whether you want to see the detail or summary
information on the main form. Both fields I want to filter on are
text. Here is a sample of the code I am using.
The filtering works fine when I do them independently (see below)
Forms![frmPaymentSearc h].[sbfrmPaymentSea rch].Form.Filter = "[EKCNBR]
=" & Me![bxAcctNbr]
Forms![frmPaymentSearc h].[sbfrmPaymentSea rch].Form.Filter =
"[BREAKLVL] =" & "'" & 2 & "'"
When I combine them, I receive the error message "You canceled the
previous operation" when it hits the filterOn = true line.
strfilter = "[EKCNBR] = """ & Me![bxAcctNbr] & """" & " And " &
"[BREAKLVL] = "" & 2 & """
Forms![frmPaymentSearc h].[sbfrmPaymentSea rch].Form.Filter = strfilter
Forms![frmPaymentSearc h].[sbfrmPaymentSea rch].Form.FilterOn = True
Can anyone figure this out? Thanks for any help you can provide
textbox and select whether you want to see the detail or summary
information on the main form. Both fields I want to filter on are
text. Here is a sample of the code I am using.
The filtering works fine when I do them independently (see below)
Forms![frmPaymentSearc h].[sbfrmPaymentSea rch].Form.Filter = "[EKCNBR]
=" & Me![bxAcctNbr]
Forms![frmPaymentSearc h].[sbfrmPaymentSea rch].Form.Filter =
"[BREAKLVL] =" & "'" & 2 & "'"
When I combine them, I receive the error message "You canceled the
previous operation" when it hits the filterOn = true line.
strfilter = "[EKCNBR] = """ & Me![bxAcctNbr] & """" & " And " &
"[BREAKLVL] = "" & 2 & """
Forms![frmPaymentSearc h].[sbfrmPaymentSea rch].Form.Filter = strfilter
Forms![frmPaymentSearc h].[sbfrmPaymentSea rch].Form.FilterOn = True
Can anyone figure this out? Thanks for any help you can provide
Comment