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?

[Webinar] Streamline your web hosting managementRegister Today

x
 
JuiletteConnect With a Mentor Commented:
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
 
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
All Courses

From novice to tech pro — start learning today.