Hello,
How do I get this code to work. What it is supposed to do is if the Option button "Down" is pressed it will do the correct code for that but if the Option button "Up" is pressed it will do what was selected for that. However the code below only works if the Option "UP" is selected.Does anyone see what I am doing wrong?
VB Code:
Private Sub cmdCalc4_Click() Dim X3 As Long Dim y3 As Long If [B]OptUp.Value [/B] = True Then If lnHigh.Y1 > lnLow.Y1 Then ln146.Y1 = (lnHigh.Y1 - lnLow.Y1) * 0.146 + (lnLow.Y1) ln146.Y2 = (lnHigh.Y1 - lnLow.Y1) * 0.146 + (lnLow.Y2) lbl146.Caption = frmMain.Text1.Text Else ln146.Y1 = (lnHigh.Y1 - lnLow.Y1) * 0.146 + (lnLow.Y1) ln146.Y2 = (lnHigh.Y1 - lnLow.Y1) * 0.146 + (lnLow.Y2) lbl146.Caption = frmMain.Text1.Text End If ln146.X1 = Picture1.Left ln146.X2 = Picture1.Width ln146.Visible = True X3 = (Picture1.ScaleWidth - Picture1.ScaleLeft) / 2 y3 = ln146.Y2 + 0.8 lbl146.Move X3, y3 lbl146.Visible = True End If If [B]Optdown.Value[/B] = True Then If lnHigh.Y1 > lnLow.Y1 Then ln146.Y1 = (lnHigh.Y1 - lnLow.Y1) * 0.146 - (lnHigh.Y1) ln146.Y2 = (lnHigh.Y1 - lnLow.Y1) * 0.146 - (lnHigh.Y2) lbl146.Caption = frmMain.Text1.Text Else ln146.Y1 = (lnHigh.Y1 - lnLow.Y1) * 0.146 - (lnHigh.Y1) ln146.Y2 = (lnHigh.Y1 - lnLow.Y1) * 0.146 - (lnHigh.Y2) lbl146.Caption = frmMain.Text1.Text End If ln146.X1 = Picture1.Left ln146.X2 = Picture1.Width ln146.Visible = True X3 = (Picture1.ScaleWidth - Picture1.ScaleLeft) / 2 y3 = ln146.Y2 + 0.8 lbl146.Move X3, y3 lbl146.Visible = True End If End Sub
Thank you and have a great day!![]()
Stilekid007![]()




Does anyone see what I am doing wrong?
Reply With Quote