Hi All,
Trying to load a result from a query to a variable - currRate. When I get to code line "currRate = objRec.GetString(adClipString, ColumnDelimeter:=" ", RowDelimeter:=vbCrLf)", I get the following error.
Run-time error '3021':
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
The table only has one row in it - a currency rate.
Any help would be most appreciated.
TIA,
Tim
Trying to load a result from a query to a variable - currRate. When I get to code line "currRate = objRec.GetString(adClipString, ColumnDelimeter:=" ", RowDelimeter:=vbCrLf)", I get the following error.
Run-time error '3021':
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
The table only has one row in it - a currency rate.
Any help would be most appreciated.
Code:
Dim strSQL As String
Dim currRate As Currency
Dim objRec As ADODB.Recordset
strSQL = "SELECT rate FROM qryCurrentRate;"
Set objRec = New ADODB.Recordset
objRec.Open strSQL, CurrentProject.Connection, adOpenStatic, adLockReadOnly, adCmdText
currRate = objRec.GetString(adClipString, ColumnDelimeter:=" ", RowDelimeter:=vbCrLf)
MsgBox (currRate)
objRec.Close
Set objRec = Nothing
TIA,
Tim