• aggregate function to textbox (access 2003)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » aggregate function to textbox (access 2003)

    Author
    Topic
    #437184

    Trying assign to Control Source of text box aggregate function that counts number of records with certain criteria- the query works good, but text box doesn’t want to accept the value and gives me #Name ( I have tried to assign value using Build feature)

    Thank you
    Alex

    Viewing 1 reply thread
    Author
    Replies
    • #1038553

      I am not sure if this is any help, but…

      I find that if I create a form with a control bound to a field in the underlying table/query, then change the control source to some calculated value (that includes the original field) I often get the #Name error.

      The problem is that initially both the Control Source and the Name of the control are set to the field name. To fix it I need to change the Name of the control so it is different from the field name. Typically I put a txt in front of it (if it is a text box).

    • #1038558

      Welcome to Woody’s Loung1

      If John’s suggestion doesn’t solve your problem, you might try setting the control source of the text box to a formula like this:

      =DCount(“*”,”QueryName”)

      to display the count of all records in the query QueryName, or

      =DCount(“*”,”QueryName”,”SomeField = 12″)

      to display the count of records in QueryName for which the field SomeField is equal to 12.

    Viewing 1 reply thread
    Reply To: Reply #1038553 in aggregate function to textbox (access 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel