code problems

can you tell me why the else part of this codeing does not work

Private Sub Form_Paint()
Line (100, 150)-(900, 150), 0
Line (100, 160)-(900, 160), 0
Line (100, 100)-(900, 800), 0, B
CurrentX = 440: CurrentY = 100
Print "Invoice Table"
CurrentX = 170: CurrentY = 210
  If Form1.optSmall = 1 Then
   Print (Form1.optSmall.Caption)
   
    ElseIf Form1.optMedium = 1 Then
       Print (Form1.optMedium.Caption)
       
        ElseIf Form1.optLarge = 1 Then
        Print (Form1.optLarge.Caption)
 
 
   End If
LVL 1
michaeldiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

trilloCommented:
I just tried it and it worked.... What kind of error do you get?
0
JuiletteCommented:
use Case Select it's much cleaner.

Select Case Caption
Case Lower
'your code
Case Medium
'your code
Case Large
'Your code
End Select


0
JuiletteCommented:
Private Sub Form_Paint()
Line (100, 150)-(900, 150), 0
Line (100, 160)-(900, 160), 0
Line (100, 100)-(900, 800), 0, B
CurrentX = 440: CurrentY = 100
Print "Invoice Table"
CurrentX = 170: CurrentY = 210

 Dim sCaption$
 
 
 If Form1.optSmall.Value = True Then sCaption = "1"
 If optmedium.Value = True Then sCaption = "2"
 If optLarge.Value = True Then sCaption = "3"
 
  Select Case sCaption
  Case "1"
  Print Form1.optSmall.Caption
  Case "2"
  Print Form1.optmedium.Caption
  Case "3"
  Print Form1.optLarge.Caption
  End Select
 
 
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.