Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    Switzerland
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Binding variable query to field ? Possible ? (2003)

    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

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Binding variable query to field ? Possible ? (2003)

    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
    Francois

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •