C
Cathy via AccessMonster.com
Hi,
I've created an ADO recordset and it appears to work fine. I now want to
filter it to show records for a particular field, i.e. SamplePoint. In the
code below, the message box returns the correct sample point name (e.g. MW-99)
, my stSQL statement looks right ("SELECT * FROM tbl_purgeparameters WHERE
[SamplePoint ] = MW-99"), but I get "Run-time error '-2147217904(8004e10)':
No value given for one or more required parameters" when it hits my RSfile.
Open stSQL, CurrentProject.Connection, adOpenKeyset line.
I'm not sure where to go from here. Please help.
My code is as follows:
Dim cnn As New ADODB.Connection
Dim RSfile As New ADODB.Recordset
Dim stDocName As String
Dim stSQL As String
Dim stSample As String
stDocName = "tbl_purgeparameters"
stSample = Me.SamplePoint
MsgBox "samplepoint is " & Me.SamplePoint
Set cnn = New ADODB.Connection
stSQL = "SELECT * FROM tbl_purgeparameters WHERE [SamplePoint] = " & Me.
SamplePoint
Set RSfile = New ADODB.Recordset
RSfile.Open stSQL, CurrentProject.Connection, adOpenKeyset
Thanks in advance.
Cath
I've created an ADO recordset and it appears to work fine. I now want to
filter it to show records for a particular field, i.e. SamplePoint. In the
code below, the message box returns the correct sample point name (e.g. MW-99)
, my stSQL statement looks right ("SELECT * FROM tbl_purgeparameters WHERE
[SamplePoint ] = MW-99"), but I get "Run-time error '-2147217904(8004e10)':
No value given for one or more required parameters" when it hits my RSfile.
Open stSQL, CurrentProject.Connection, adOpenKeyset line.
I'm not sure where to go from here. Please help.
My code is as follows:
Dim cnn As New ADODB.Connection
Dim RSfile As New ADODB.Recordset
Dim stDocName As String
Dim stSQL As String
Dim stSample As String
stDocName = "tbl_purgeparameters"
stSample = Me.SamplePoint
MsgBox "samplepoint is " & Me.SamplePoint
Set cnn = New ADODB.Connection
stSQL = "SELECT * FROM tbl_purgeparameters WHERE [SamplePoint] = " & Me.
SamplePoint
Set RSfile = New ADODB.Recordset
RSfile.Open stSQL, CurrentProject.Connection, adOpenKeyset
Thanks in advance.
Cath