Hi,
Please help me my " all-better-one"
I have tried to write code in VB to make a small calculator on the Access-Form. The problem is it does not return the decimal value like ( 2.56 + 3.45= 6.???? ).
Here are the code i wrote.
***
Dim Getal1 As Long
Dim Getal2 As Long
Dim Getal3 As Long
Dim Komaf As Long
Dim hulp As String
Private Sub Tekst1_LostFocus()
TelOp
'Komaf = 1
End Sub
Private Sub Tekst2_LostFocus()
TelOp
End Sub
Public Function TelOp()
'Dim total As Single
'total = Val(Tekst1.Text) + Val(Tekst2.Text)
On Error GoTo FOUT
Tekst1.SetFocus
Getal1 = Val(Tekst1.Text)
Tekst2.SetFocus
Getal2 = Val(Tekst2.Text)
Getal3 = (Getal1 + Getal2)
Getal3 = Round(Getal3, 6)
Tekst3.SetFocus
Tekst3.Locked = False
'MsgBox ("wat ")
Tekst3.Text = Getal3
Tekst3.Locked = True
'If Komaf = 1 Then
' Tekst2.SetFocus
' Else: Tekst2.SetFocus
'End If
FOUT:
End Function
****