I made a form in ACEESS, which contains a subform. The control source of the subform is a query without filtering conditions. In the form, a subform filtering condition is generated using VBA. For example, after filtering conditions are entered in the form, the subform filter result is: Customer Field 1 Field 2... (subform header) A12B01C21A10? 44 customers... (sub
I made a form in ACEESS, which contains a subform. The control source of the subform is a query without filtering conditions. In the form, a subform filtering condition is generated using VBA. For example, after filtering conditions are entered in the form, the subform filter result is: Customer Field 1 Field 2 .... (subform header) A 1 2 B 0 1 C 2 1 A 1 0 total? Customers 4 4... (sub
I made a form in ACEESS, which contains a subform. The control source of the subform is a query without filtering conditions. In the form, a subform filtering condition is generated using VBA.
For example, after filtering conditions are entered in the form, the subform filter result is:
Customer Field 1 Field 2... (subform header)
A 1 2
B 0 1
C 2 1
A 1 0
Total? Customers 4... (child form footer, used to calculate the sum of the number of each field)
Because the customer fields will be repeated, I want to create a text box in the footer of the child form, count the number of unique users after each form filter result, and display it in the file box. I tried many methods, but DISTINCT does not apply to the control source of the text box. Can the control source in the text box be implemented? How can I consult experts?
Question added: I know this select statement, but it can only be used in queries. I don't know if the functions I want can be implemented in subforms?
Best Answer
For select statements, the access Database supports the DISTINCT keyword, but the clustering function does not.
It can be written in this way.
Select count (*) from (select distinct field name to be counted from table name)