JackKaptijn
Registered User.
- Local time
- Today, 12:47
- Joined
- Dec 10, 2012
- Messages
- 38
I have an Access 2007 database.
In it there are Class Modules but also Modules.
I have transferred all modules into Class Modules because of the use of variables and values in a multi user environment.
Her is an example of a class module which does a validation check on a bankaccount number:
Function ElfProef(ByVal Rekeningnummer As Variant) As Boolean
Dim blnElfProef As Boolean
Dim i As Integer, iTest As Integer
blnElfProef = False
Select Case Len(Nz(Rekeningnummer, ""))
Case 7
blnElfProef = True
Case 9
For i = 9 To 1 Step -1
iTest = iTest + (i * Val(Mid(Rekeningnummer, (10 - i), 1)))
Next i
If iTest Mod 11 = 0 Then
blnElfProef = True
End If
Case 10
For i = 1 To 10
iTest = iTest + (i * Val(Mid(Rekeningnummer, i, 1)))
Next i
If iTest Mod 11 = 0 Then
blnElfProef = True
End If
Case Else
End Select
ElfProef = blnElfProef
End Function
The problem.....
When I create a query you can include custom build functions.
But only functions in modules are visible and NOT functions in a Class Module.
Anyone a suggestion?
In it there are Class Modules but also Modules.
I have transferred all modules into Class Modules because of the use of variables and values in a multi user environment.
Her is an example of a class module which does a validation check on a bankaccount number:
Function ElfProef(ByVal Rekeningnummer As Variant) As Boolean
Dim blnElfProef As Boolean
Dim i As Integer, iTest As Integer
blnElfProef = False
Select Case Len(Nz(Rekeningnummer, ""))
Case 7
blnElfProef = True
Case 9
For i = 9 To 1 Step -1
iTest = iTest + (i * Val(Mid(Rekeningnummer, (10 - i), 1)))
Next i
If iTest Mod 11 = 0 Then
blnElfProef = True
End If
Case 10
For i = 1 To 10
iTest = iTest + (i * Val(Mid(Rekeningnummer, i, 1)))
Next i
If iTest Mod 11 = 0 Then
blnElfProef = True
End If
Case Else
End Select
ElfProef = blnElfProef
End Function
The problem.....
When I create a query you can include custom build functions.
But only functions in modules are visible and NOT functions in a Class Module.
Anyone a suggestion?