Form fields don't need to always be filled in

  • Thread starter Thread starter tbmarlie
  • Start date Start date
T

tbmarlie

I have a form with 4 fields, Company, TaxID, TaxType and Year.
Sometimes, all of the fields will be filled in and then when I run my
macro, it runs the macros/queries pulling in the values from these
form fields. However, I don't always need to have the user enter
information in all of the fields on this form. In those cases, I just
want the query to act as though that field is not part of the criteria
in the query builder in access. For example, if I dont want any value
entered in the company form field, I will erroneously get no records
in my results even though I know I should have 40 records. If I
delete the [Forms]![Frm_Main]![EnterCompany] from the company criteria
in qry builder, I get the 40 records, but I need to keep the [Forms]!
[Frm_Main]![EnterCompany] in the criteria in case there is data input
in the company field on the form. How do I get my macro to pull the
proper results if one of my form fields does not need to have data
input into it? Thanks.
 
I have a form with 4 fields, Company, TaxID, TaxType and Year.
Sometimes, all of the fields will be filled in and then when I run my
macro, it runs the macros/queries pulling in the values from these
form fields.  However, I don't always need to have the user enter
information in all of the fields on this form.  In those cases, I just
want the query to act as though that field is not part of the criteria
in the query builder in access.  For example, if I dont want any value
entered in the company form field, I will erroneously get no records
in my results even though I know I should have 40 records.  If I
delete the [Forms]![Frm_Main]![EnterCompany] from the company criteria
in qry builder, I get the 40 records, but I need to keep the [Forms]!
[Frm_Main]![EnterCompany] in the criteria in case there is data input
in the company field on the form.  How do I get my macro to pull the
proper results if one of my form fields does not need to have data
input into it?  Thanks.

IGNORE THIS - I FIGURED OUT MY PROBLEM.
 
Back
Top