I have the following code in my application; Now I Migrated the tables to a sharepoint and I get an unknown error on the last line:
I did create the code by copy and paste; I'm not an expert on it but it worked until now!
Public Function BepaalLidnummer()
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset
Dim Prm As ADODB.Parameter
Dim Postkod As String
Dim cmd2 As ADODB.Command
Dim rs2 As ADODB.Recordset
Dim Prm2 As ADODB.Parameter
Dim LidGevonden As Boolean, WachterGevonden As Boolean, strLidnum As String
'initialiseren indikatoren
LidGevonden = True
WachterGevonden = True
'4 linker cijfers gebruiken of anders 9999
If IsNumeric(Left(Forms![Wachters]![Postcode], 4)) = True Then
Postkod = Left(Forms![Wachters]![Postcode], 4) & "%"
Else
Postkod = "9999%"
End If
'Hoogste nummer ophalen uit leden
Set rs = New Recordset
Set cmd = New Command
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = "HoogsteLidnummerLeden" 'this is a query
Set Prm = cmd.CreateParameter
Prm.Type = adChar
Prm.Size = 25
cmd.Parameters.Append Prm
cmd.Parameters(0).Value = Postkod
rs.Open cmd, , adOpenForwardOnly, adLockReadOnly, adCmdStoredProc
Any suggestion how to solve?
Help will be appriciated very much!
I did create the code by copy and paste; I'm not an expert on it but it worked until now!
Public Function BepaalLidnummer()
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset
Dim Prm As ADODB.Parameter
Dim Postkod As String
Dim cmd2 As ADODB.Command
Dim rs2 As ADODB.Recordset
Dim Prm2 As ADODB.Parameter
Dim LidGevonden As Boolean, WachterGevonden As Boolean, strLidnum As String
'initialiseren indikatoren
LidGevonden = True
WachterGevonden = True
'4 linker cijfers gebruiken of anders 9999
If IsNumeric(Left(Forms![Wachters]![Postcode], 4)) = True Then
Postkod = Left(Forms![Wachters]![Postcode], 4) & "%"
Else
Postkod = "9999%"
End If
'Hoogste nummer ophalen uit leden
Set rs = New Recordset
Set cmd = New Command
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = "HoogsteLidnummerLeden" 'this is a query
Set Prm = cmd.CreateParameter
Prm.Type = adChar
Prm.Size = 25
cmd.Parameters.Append Prm
cmd.Parameters(0).Value = Postkod
rs.Open cmd, , adOpenForwardOnly, adLockReadOnly, adCmdStoredProc
Any suggestion how to solve?
Help will be appriciated very much!