Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
If IsNumeric(Me.txtInp) Then
Me.txtOut = Me.txtInp) / 4
Else
Me.txtOut = "huh"
End If
[blue] Dim prp As Property, errName As String
Dim C1 As Double, C2 As Double
Dim Msg As String, Style As Integer, Title As String, DL As String
Set prp = Me!Op.Properties("Caption")
Style = vbInformation + vbOKOnly
Title = "Data Entry Error! . . ."
DL = vbNewLine & vbNewLine
[green]'Validation[/green]
If Not IsNumeric(Me!Dat1) Then
errName = "Dat1"
ElseIf Not IsNumeric(Me!Dat2) Then
errName = "Dat2"
ElseIf Me!Dat2 = 0 Then
errName = "Zero"
End If
If errName = "" Then
C1 = CDbl(Me!Dat1) [green]'convert to double percision[/green]
C2 = CDbl(Me!Dat2) [green]'convert to double percision[/green]
If prp = "+" Then
prp = "-"
Me!Ans = C1 - C2
ElseIf prp = "-" Then
prp = "x"
Me!Ans = C1 * C2
ElseIf prp = "x" Then
prp = "/"
Me!Ans = C1 / C2
Else
prp = "+"
Me!Ans = C1 + C2
End If
Else
If errName = "Zero" Then
Msg = "Can't divide by zero!"
Else
Msg = "Data Entry missing or non-numeric!"
End If
MsgBox Msg, Style, Title
If errName = "zero" Or errName = "Dat2" Then
Me!Dat2.SetFocus
Else
Me!Dat1.SetFocus
End If
End If
Set prp = Nothing[/blue]