W
WoollyBear
I have constructed the following piece of code, triggered from a command
button. Despite several attempts the following error message is displayed,
"No value given for one or more required parameters". I have debugged the
SELECT statement and used the Immediate window to verify that the two
parameter fields do contain values. Does anybody have any ideas please?
' Declare the ADO variable for the tbl_Referral_Data recordset
Dim rstbl_RefSEN As New ADODB.Recordset
' Declare the tbl_Referral_Data SQL statement variable
Dim RefSENSQLStmt As String
' Declare variable for closed referral indicator and set to "Y"
Dim ref_ClosedInd As String
ref_ClosedInd = "Y"
' Select the required data from tbl_Referral_Data and display the SEN data
on the form
RefSENSQLStmt = "SELECT * FROM tbl_Referral_Data WHERE
Child_ID = " & temp_ChildID & " AND Ref_Completed_Ind =" & ref_ClosedInd
rstbl_RefSEN.Open RefSENSQLStmt,
CurrentProject.Connection, adOpenDynamic, adLockReadOnly
If Not rstbl_RefSEN.EOF Then
button. Despite several attempts the following error message is displayed,
"No value given for one or more required parameters". I have debugged the
SELECT statement and used the Immediate window to verify that the two
parameter fields do contain values. Does anybody have any ideas please?
' Declare the ADO variable for the tbl_Referral_Data recordset
Dim rstbl_RefSEN As New ADODB.Recordset
' Declare the tbl_Referral_Data SQL statement variable
Dim RefSENSQLStmt As String
' Declare variable for closed referral indicator and set to "Y"
Dim ref_ClosedInd As String
ref_ClosedInd = "Y"
' Select the required data from tbl_Referral_Data and display the SEN data
on the form
RefSENSQLStmt = "SELECT * FROM tbl_Referral_Data WHERE
Child_ID = " & temp_ChildID & " AND Ref_Completed_Ind =" & ref_ClosedInd
rstbl_RefSEN.Open RefSENSQLStmt,
CurrentProject.Connection, adOpenDynamic, adLockReadOnly
If Not rstbl_RefSEN.EOF Then