Your code will fail if 2 of the 3 textboxes (or even 1 of them) is blank. Try this.Code:Private Sub Command1_Click() Dim degrees As Double Dim minutes As Double Dim seconds As Double Dim decimals As Double If Trim$(Text1.Text) = "" Or Trim$(Text2.Text) = "" Or Trim$(Text3.Text) = "" Then MsgBox "Please key in your input values", vbInformation, "Degree Converter" Else degrees = CDbl(Text1.Text) minutes = CDbl(Text2.Text) / 60 seconds = CDbl(Text3.Text) / 3600 decimals = degrees + minutes + seconds Label6.Caption = decimals End If End Sub




Reply With Quote