troubleshooting Question

(very) simple program design question

Avatar of gliese581
gliese581 asked on
Microsoft DevelopmentWeb Components
8 Comments2 Solutions276 ViewsLast Modified:
I can run the attached sample code from an Access Module. Where do I put it in VB 6 to create an executable??  Is it necessarilly somehow embedded in a form?

Eventually, I will want to display one of 1200 documents selected through a similar hierarchy of yes/no dialog boxes.  Should I use VB forms or msgboxes to dialog with the user?


Public Function DecisionTree()
Dim ans_23 As Integer
Dim ans_31_33 As Integer
Dim ans_42_45 As Integer
Dim ans_48_49 As Integer
ans_23 = MsgBox("Are you a general contractor, sub-contactor, or specialized contractor?", vbYesNoCancel + vbQuestion, "Please Respond")
ans_31_33 = MsgBox("Are you engaged in agriculture, production, manufacturing, or mining of a product or commodity?", vbYesNoCancel + vbQuestion, "Please Respond")
ans_42_45 = MsgBox("Are you engaged in buying or selling of products or commodities?", vbYesNoCancel + vbQuestion, "Please Respond")
ans_48_49 = MsgBox("Are you engaged in the transportation of freight or passengers by any more including air, truck, boat, pipeline, etc.?", vbYesNoCancel + vbQuestion, "Please Respond")
 
    Select Case ans_31_33
        Case vbYes
            MsgBox "yes_31_33"
        Case vbNo
            Select Case ans_42_45
                Case vbYes
                    MsgBox "yes_42_45"
                Case vbNo
                    Select Case ans_23
                        Case vbYes
                            MsgBox "yes_23"
                        Case vbNo
                            Select Case ans_48_49
                                Case vbYes
                                    MsgBox "yes_48_49"
                                Case vbNo
                                  MsgBox "no_48_49"
                                Case vbCancel
                                    MsgBox "cancel_48_49"
                            End Select
                        Case vbCancel
                            MsgBox "cancel_23"
                    End Select
                Case vbCancel
                    MsgBox "cancel_42_45"
            End Select
        Case vbCancel
            MsgBox "cancel_31_33"
    End Select
End Function
ASKER CERTIFIED SOLUTION
Mike Tomlinson
High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Top Expert 2009

The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.

Join our community to see this answer!
Unlock 2 Answers and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros