Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2002
    Location
    Northampton, England
    Posts
    266

    Unanswered: Number of records

    I am trying to get the number of records between two dates and put the result into a text box on the same form as the start date and end date. I can do this in a report, but I am stumped on how to achieve the result in a text box. I am using the following SQL to counts the records,

    SELECT DISTINCTROW Count(*) AS [No of Internal] FROM Nonconformances WHERE (((Nonconformances.DateRaised) Between [forms]![frmReports]![StartDate] And [forms]![frmReports]![EndDate]) AND ((Nonconformances.[C or I])="I"));

    I have tried putting the SQL into the contol source of the text box but just get a Name error. Any suggestions please.

    David

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi DJN

    Check out DCount in help to do this - you can't use SQL in a textbox control source.

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Aug 2002
    Location
    Northampton, England
    Posts
    266
    Thanks a lot Pootle.

    David

Posting Permissions

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