I have teh following code and keep getting an error which I cannot find:
Cannot find item in collection....
Here is my code:
Public Function BepaalLidnummer()
Dim cat As New ADOX.Catalog
Dim cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
cat.ActiveConnection = CurrentProject.Connection
cmd.CommandText = "Parameters [Postkod] string; SELECT * FROM Tbl_leden WHERE (((Tbl_leden.DD) Like [Postkod])) ORDER BY Tbl_leden.DD DESC"
cat.Procedures.Append "LedenHoogsteLidnummer", cmd
Set cmd = cat.Procedures("LedenHoogsteLidnummer").Command
cmd.Parameters("Postkod") = "9999" <<<<<<<< here is the error line
rs.Open cmd, , adOpenForwardOnly, adLockReadOnly, adCmdStoredProc
Cannot find item in collection....
Here is my code:
Public Function BepaalLidnummer()
Dim cat As New ADOX.Catalog
Dim cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
cat.ActiveConnection = CurrentProject.Connection
cmd.CommandText = "Parameters [Postkod] string; SELECT * FROM Tbl_leden WHERE (((Tbl_leden.DD) Like [Postkod])) ORDER BY Tbl_leden.DD DESC"
cat.Procedures.Append "LedenHoogsteLidnummer", cmd
Set cmd = cat.Procedures("LedenHoogsteLidnummer").Command
cmd.Parameters("Postkod") = "9999" <<<<<<<< here is the error line
rs.Open cmd, , adOpenForwardOnly, adLockReadOnly, adCmdStoredProc