Hi, Im taking an introduction visual basic course and I am having problems with vbYesNo. If "No" is clicked, the program will clear the textbox and allow a new value to be entered, which is what i wanted. But for some reason when the user clicks "Yes" the program will not continue on to the calculation. Does anybody know why this is?? Thanks for your help.
If check1 = True Then
If Text1(0).Text < 4 Or Text1(0).Text > 9 Then
dummy = MsgBox("Are you sure the value entered for Compound #1 Coefficient A is correct?", vbYesNo, "Value Entered Is Not Characteristic")
If dummy = vbNo Then
Text1(0).Text = ""
check1 = False
ElseIf dummy = vbYes Then
check1 = True
Add a breakpoint to your code, then step through it using the F8 key.
You can pause the mouse pointer over the variables and constants to see what they contain.
You might also want to explicitly convert the text box entries to integer, rather than let the VB compiler implicitly convert them to what IT thinks best.
If (CInt(Text1(0).Text) < 4) Or (CInt(Text1(0).Text) > 9) Then
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert