Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jul 2003
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Testing results of a query for job completion (1997)

    <img src=/S/jollyroger.gif border=0 alt=jollyroger width=29 height=18>

    On a form that tracks reviews of several stations on a subform, the below query returns the results of the review; whether it is complete or not. On the Form there is a field holding the number of stations to be reviewed. I'm creating a form that will show (among other things) if the review is complete. The rules for completion are this:

    A station is complete if has a "yes" in the complete field AND a "die" in the die field. The number of complete stations must match the number of stations indicated on the main form.

    The query returns the following:
    JobNum------StationNum------Complete-------DieOrIdle

    for example: if a Job has 5 stations to be reviewed, and the query returns these results:

    JobNum------StationNum--------Complete-------DieOrIdle
    2666---------------1---------------- yes--------------die
    2666-------------- 2 --------------- yes ------------ idle
    2666 ------------- 3 ---------------- yes ---------- die
    2666 ------------- 4 ---------------- yes ----------- die
    2666 ------------- 5----------------- no ------------- die

    ... the review would not be complete, since only 3 stationsout of the nessissary 5 were completed.

    I want to use the results of this test to toggle the visibility of Label on the summary form.

    Thanks for any suggestions,
    Keith

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Testing results of a query for job completion (1997)

    Say that txtJobNum is the name of the control on the main form that holds the job number, and that tblStationReviews is the name of the table with the results (this might be a query instead).

    DCount("*", "tblStationReviews", "JobNum=" & Me.txtJobNum & AND COMPLETE = 'yes' AND DIEORIDLE = 'die'")

    You can compare this to the number of stations:

    Me.lblSomething.Visible = (DCount("*", "tblStationReviews", "JobNum=" & Me.txtJobNum & AND COMPLETE = 'yes' AND DIEORIDLE = 'die'") = Me.txtNumberOfStations)

    Modify to conform to your situation.

  3. #3
    Star Lounger
    Join Date
    Jul 2003
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testing results of a query for job completion (1997)

    <img src=/S/jollyroger.gif border=0 alt=jollyroger width=29 height=18>


    Thanks Hans!

Posting Permissions

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