Hi, I'm trying to create an inputbox for uiJob1TextBox, uiJob2TextBox, and uiJob3TextBox. This way the user will be asked to enter a number for each textbox. Now I have my code:
I'm trying to understand what CDbl is? Because I'm thinking if i use the 'Try' statement and make job1HP equal to something else that contains in (uiJob1Textbox)VB Code:
Const RaisePercentage As String = "Raise Percentage: " Dim job1HP As Double, job2HP As Double, job3HP As Double Dim job1NewHP As Double, job2NewHP As Double, job3NewHP As Double Dim raisePercent As Double Try job1HP = CDbl(uiJob1TextBox.Text) job2HP = CDbl(uiJob2TextBox.Text) job3HP = CDbl(uiJob3TextBox.Text) Catch ex As Exception MsgBox(ex.Message(), MsgBoxStyle.Critical) uiJob1TextBox.Focus() Exit Sub End Try Do Try raisePercent = CDbl(InputBox("Please enter the raise percentage.", "Raise Percentage")) / 100 Exit Do Catch ex As Exception MsgBox(ex.Message(), MsgBoxStyle.Critical) End Try
That then I can create a raisePercent= "blah" code which will allow me to enter a InputBox for the three textboxes. Anyone have any suggestions or what
CDbl means and if I can use a different expression so this way I can have expression A equal uiJobTextbox, expression B equal textbox2, and expression C equal textbox3.
Thanks!![]()




Reply With Quote