Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set visibility of a Lable based on results of query, and comparison...

Status
Not open for further replies.

NightZEN

Programmer
Apr 29, 2003
142
US
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

[pipe]
 
You can make a table (PassTbl) with only a field (Ctrl), type Yes/No, now create only one record with value yes.

Create a query an set relationship between the Complete field and Ctrl field of PassTbl. That must show you only the record with Complete=True

Greetings from Chile
 
Hi dzepeda
How would that give me a final "yes" or "no" that I could use to set the visibility of a label?

Keith

[pipe]
 

I figured it out. Sorry, I should have spent a little more time on it. Somtimes asking the question, can shake loose the answere from the depths of the mind.

DCount was the Key - here is what I did btw ...

If Me.TbxFIR.Value = Null Then
Me.LblFIRYes.Visible = False
Me.LblFIRNo.Visible = True
Else
intStationsComp = DCount("*", "QryFIRComplete2", "[Job#] = " & Me.[Job#] & _
"AND Complete = 'Yes' AND DieIdle = 'Die' ")
If Me.TbxFIR.Value = intStationsComp Then
Me.LblFIRYes.Visible = True
Me.LblFIRNo.Visible = False
Else
Me.LblFIRYes.Visible = False
Me.LblFIRNo.Visible = True
End If
End If



[pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top