J
Jonathan
Hi, can you please check the following code to find the
error that is causing the error message...
'Method Open of Object _Recordset failed'
I just can't see it and so I am hoping the you can spot
the error.
*** code snipet start ***
Public Function SizeDesc(SizeCategory As Integer) As String
On Error GoTo SizeDesc_Err
Dim strSQL As String
Dim rsData As ADODB.Recordset
Dim strDesc As String
strSQL = "SELECT Size " _
& "FROM tblSize " _
& "WHERE (((SizeCategory)=" _
& SizeCategory _
& "));"
Set rsData = New ADODB.Recordset
With rsData
.ActiveConnection = CurrentProject.Connection
.LockType = adLockReadOnly
.CursorLocation = adUseClient
.CursorType = adOpenForwardOnly
.Source = strSQL
.Open
Do Until .EOF
***** code snippet ends ***
The code fails at the open statement. The sql works when
copied from the debug window into a query design.
Any ideas or suggestions appreciated
Cheers
Jonathan
error that is causing the error message...
'Method Open of Object _Recordset failed'
I just can't see it and so I am hoping the you can spot
the error.
*** code snipet start ***
Public Function SizeDesc(SizeCategory As Integer) As String
On Error GoTo SizeDesc_Err
Dim strSQL As String
Dim rsData As ADODB.Recordset
Dim strDesc As String
strSQL = "SELECT Size " _
& "FROM tblSize " _
& "WHERE (((SizeCategory)=" _
& SizeCategory _
& "));"
Set rsData = New ADODB.Recordset
With rsData
.ActiveConnection = CurrentProject.Connection
.LockType = adLockReadOnly
.CursorLocation = adUseClient
.CursorType = adOpenForwardOnly
.Source = strSQL
.Open
Do Until .EOF
***** code snippet ends ***
The code fails at the open statement. The sql works when
copied from the debug window into a query design.
Any ideas or suggestions appreciated
Cheers
Jonathan