M
Matthew DeAngelis
Hi everyone,
I was hoping I could get some help with a filtration problem.
I am building a search function for my database. There are two main
tables that are being searched: one that contains information specific
to companies (such as address) and one that contains information
specific to deals (such as the status of a particular interaction).
Right now, I have it set up so that users can search either company
information or deal information, and the results of a concatenated
filter string are displayed in either the main company form (with deals
listed in a continuous subform) or the deal form. This mostly works
fine, since the data is usually handled separately. I just have one
problem: a majority of the deals in the database are old, and there
will be situations where my users will want to search only the
companies that have at least one deal that is not classified as 'dead'.
The [Status] field does show up on the deals subform on the companies
form, so I added a checkbox on the search form that, when checked, adds
the line " And Forms![frmSearchByCompanyDealSubform]![Status] Not Like
'6 - Dead/No Action'" to the Filter statement. According to my VBA
book, this is the valid syntax for referencing a field on a subform,
and at least it does not spit out an error. However, checking the
checkbox, rather than returning only active deals, returns no records
at all, even if I restrict the search to a company that has only active
deals.
Does anyone know what I am doing wrong? Is there another way of doing
this?
Thanks,
Matt
I was hoping I could get some help with a filtration problem.
I am building a search function for my database. There are two main
tables that are being searched: one that contains information specific
to companies (such as address) and one that contains information
specific to deals (such as the status of a particular interaction).
Right now, I have it set up so that users can search either company
information or deal information, and the results of a concatenated
filter string are displayed in either the main company form (with deals
listed in a continuous subform) or the deal form. This mostly works
fine, since the data is usually handled separately. I just have one
problem: a majority of the deals in the database are old, and there
will be situations where my users will want to search only the
companies that have at least one deal that is not classified as 'dead'.
The [Status] field does show up on the deals subform on the companies
form, so I added a checkbox on the search form that, when checked, adds
the line " And Forms![frmSearchByCompanyDealSubform]![Status] Not Like
'6 - Dead/No Action'" to the Filter statement. According to my VBA
book, this is the valid syntax for referencing a field on a subform,
and at least it does not spit out an error. However, checking the
checkbox, rather than returning only active deals, returns no records
at all, even if I restrict the search to a company that has only active
deals.
Does anyone know what I am doing wrong? Is there another way of doing
this?
Thanks,
Matt