I have a From_Load event that sets the input parameters and recordsource for a subform.
If I only have the @SEARCH parameter (varchar(50)) in the stored procedure and only pass this parameter it works fine, however if I try to pass the @CREATE_DATE parameter(smalldatetime) I get the following error:-
2757:- There was a problem accessing a property or method of the OLE object.
If I open the stored procedure using ADO Open command and pass parameters this works fine too so I know that the stored procedure works fine.
Below is my Form_Load event
Private Sub Form_Load()
On Error GoTo Error_Handler
'// Set the Input Parameters, set the Subforms recordsource to the stored procedure
With Me.fsubBatch_Track_List.Form
.InputParameters = "@CREATE_DATE = " & gstr_BT_Date & ", @SEARCH = '" & gstr_BT_String & "'"
.RecordSource = "zp_Batch_Track_List"
End With
Exit_Error_Handler:
Exit Sub
Error_Handler:
StdErrMsg
Resume Exit_Error_Handler
End Sub
If I only have the @SEARCH parameter (varchar(50)) in the stored procedure and only pass this parameter it works fine, however if I try to pass the @CREATE_DATE parameter(smalldatetime) I get the following error:-
2757:- There was a problem accessing a property or method of the OLE object.
If I open the stored procedure using ADO Open command and pass parameters this works fine too so I know that the stored procedure works fine.
Below is my Form_Load event
Private Sub Form_Load()
On Error GoTo Error_Handler
'// Set the Input Parameters, set the Subforms recordsource to the stored procedure
With Me.fsubBatch_Track_List.Form
.InputParameters = "@CREATE_DATE = " & gstr_BT_Date & ", @SEARCH = '" & gstr_BT_String & "'"
.RecordSource = "zp_Batch_Track_List"
End With
Exit_Error_Handler:
Exit Sub
Error_Handler:
StdErrMsg
Resume Exit_Error_Handler
End Sub