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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assessing values in combo boxes 1

Status
Not open for further replies.

dbero

Technical User
Mar 31, 2005
109
US
I have 6 combo boxes that default to "Passed". The combo box can be set to fail if the test it represents is not passed. After the combo boxes are set, or left as passed, I want to view the results and set a master value that indicates if any of the items are not set to passed. If not, then the overall record is failed. Is there an easy way to look at all combo boxes, assess what they are, then set a master passed/fail field?
Thank you.
 
How are ya dbero . . .
[ol][li]In the [blue]Tag[/blue] property of the 6 combo's enter a question mark [blue]?[/blue] ([red]no quotations please[/red]).[/li]
[li]Set the [blue]Locked[/blue] property of the [blue]Master[/blue] textbox to [purple]Yes[/purple]. This prevents editing of the control by users.[/li]
[li]In the code module of the form, copy/paste the following routine:
Code:
[blue]Public Sub SetPassFail()
   Dim ctl As Control, PF As String
   
   PF = "Passed"
   
   For Each ctl In Me.Controls
      If ctl.Tag = "?" Then
         If ctl = "Failed" Then
            PF = ctl
            Exit For
         End If
      End If
   Next
   
   Me.[purple][B][I]MasterTextboxName[/I][/B][/purple] = PF
   
End Sub[/blue]
[/li]
[li]In the [blue]After Update[/blue] event of each combo and the forms [blue]On Load[/blue] event, copy paste the following line:
Code:
[blue]   Call SetPassFail[/blue]
[/li]
[li]Thats it ... perform your testing![/li][/ol]
[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Wow, that looks like it will work great. Thank you very much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top