No Current Record

  • Thread starter Thread starter krzysztof via AccessMonster.com
  • Start date Start date
Hello
I have a problem with a DAO Recordset.

i keep receiving a "No Current Record" error. I know WHY i am getting this,
it is because the SQL statement returns nothing.

i want to account for this event. i want the text field on the form to
display zero. this seems like it should not be this hard

here is the code:

For i = 0 to 10
LocationID = MyArray(i,0)

sqlCode = "a sql statement"

Set WRC_RS = mydb.OpenRecordset(sqlCode)
WRC_RS.MoveFirst

If IsNull(WRC_RS) = True Then
Me.Form("wrc_" & LocationID) = 0
Me.Form("wrc_amount_" & LocationID) = 0
Else
Me.Form("wrc_" & LocationID) = WRC_RS("Orders")
Me.Form("wrc_amount_" & LocationID) = WRC_RS("TotalAmount")
End If
Next i

WRC_RS.Close
Set WRC_RS = Nothing


i have tried a lot of methods, none work.


TIA

~K
 
Back
Top