• Binding variable query to field ? Possible ? (2003)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Binding variable query to field ? Possible ? (2003)

    Author
    Topic
    #400681

    Folks

    I’d like to display a field in a form which value is the result of a SELECT count( … ) statement.

    For instance I have a Parent Child table structure and I’d like to display in a form the count of the number of Child records that meet a given criteria for the current Parent record.

    I have a working query taking as a parameter the Parent table primary key… but how do I bind the field to that query ? What syntax should I use ? And yes, I’d rather avoid any VBA if possible…

    Thanks & regards

    Alex

    Viewing 1 reply thread
    Author
    Replies
    • #783382

      You could use the dcount function instead of a select statment.
      Set the controlsource of the textbox to something like this :
      =DCount(“*”,”tblChild”,”[IDParent] = ” & [txtParent])
      This suppose you have the IDparent on your form in a textbox named txtParent

    • #783383

      You could use the dcount function instead of a select statment.
      Set the controlsource of the textbox to something like this :
      =DCount(“*”,”tblChild”,”[IDParent] = ” & [txtParent])
      This suppose you have the IDparent on your form in a textbox named txtParent

    Viewing 1 reply thread
    Reply To: Reply #783382 in Binding variable query to field ? Possible ? (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