J
JR
Hi,
I want to control a value in a form
a made a function that works fine in the vbe
when i check the value in a form it always tells me "not ok"
what do i wrong
Jan
Public Function f_CheckNR(sNummer As String) As Boolean
Dim s1 As String, s2 As String, s3 As String
Dim n1 As Double, N2 As Integer
Dim nRest As Integer
'MsgBox sNummer
If Len(sNummer) = 12 Then
s1 = Left(sNummer, 3)
s2 = Mid(sNummer, 4, 7)
s3 = Right(sNummer, 2)
n1 = Val(s1 & s2)
N2 = Val(s3)
nRest = n1 Mod 97
f_CheckNR = (N2 = nRest)
End If
End Function
I want to control a value in a form
a made a function that works fine in the vbe
when i check the value in a form it always tells me "not ok"
what do i wrong
Jan
Public Function f_CheckNR(sNummer As String) As Boolean
Dim s1 As String, s2 As String, s3 As String
Dim n1 As Double, N2 As Integer
Dim nRest As Integer
'MsgBox sNummer
If Len(sNummer) = 12 Then
s1 = Left(sNummer, 3)
s2 = Mid(sNummer, 4, 7)
s3 = Right(sNummer, 2)
n1 = Val(s1 & s2)
N2 = Val(s3)
nRest = n1 Mod 97
f_CheckNR = (N2 = nRest)
End If
End Function