G
Guest
I would like to put a text box on a form that displays the count of the
number of records in the underlying table that have the same values as the
values for two fields in the record being displayed in the form. For
example, suppose the Field1 field in the record in the form has the value 6
and the Field2 field in the form has the value 4. I would like to display in
the new field the total number of records in the table that have these two
values for Field1 and Field2. Presumably I can run a SQL statement using the
Count function something like this:
Select count(*) from MyTable where Field1=6 & Field2=4
However, the 6 and 4 above would be replaced by variables that reflect the
appropriate values, as taken from the form. Presumably I could attach the
query to the ControlSource field in the properties of the control (text box)
I put in the form. But I can’t figure out the proper syntax for the Control
Source.
Am I approaching this properly?
Can you suggest the proper syntax for the control source?
Thank you for you help.
number of records in the underlying table that have the same values as the
values for two fields in the record being displayed in the form. For
example, suppose the Field1 field in the record in the form has the value 6
and the Field2 field in the form has the value 4. I would like to display in
the new field the total number of records in the table that have these two
values for Field1 and Field2. Presumably I can run a SQL statement using the
Count function something like this:
Select count(*) from MyTable where Field1=6 & Field2=4
However, the 6 and 4 above would be replaced by variables that reflect the
appropriate values, as taken from the form. Presumably I could attach the
query to the ControlSource field in the properties of the control (text box)
I put in the form. But I can’t figure out the proper syntax for the Control
Source.
Am I approaching this properly?
Can you suggest the proper syntax for the control source?
Thank you for you help.