Bottom line, this answer works but you need to be aware of the idiosyncrasies of . The DAO Recordcount is NEVER inaccurate for an empty recordset. That is, if it's zero, you know it's empty and not going to change. Also, if it's any number greater than 0, you know it's a non-empty recordset -- 100% reliably.
Be aware that Record Count in this case may not give you an accurate total recordcount. That said, it will be greater than 0 if there are any records.
As an Access developer — or even as a power user — you won't get far if you can't work with the Recordset object.
But it's easy to go astray, and there are a number of mistakes that even experts make. Often, we're unaware of a subtle nuance between the two object libraries, Data Access Objects (DAO) and Active X Data Objects (ADO).
Manufacturer_Order_ID as Order_Man_ID, " & _ "M_Mnu_Odr.
Luckily, you can avoid some of the most common mistakes if you just plan for them.
This Access transaction processing example shows you how to assure that all or no tables get updated in a multi-table transaction. Close ' myformat = Format(Date, "mm/dd/yyyy") ' str Input = Input Box("Today's Date or enter another date", "Faxed Date", myformat) If str Input = "" Then Msg Box "This function has been canceled." Exit Sub End If ' On Error Go To bad_date Thedate = CDate(str Input) Go To Good_date bad_date: Msg Box Err.
The setup for this example is as follows: We have a form which lists customer orders of Widgets. Workspace Dim sqltext As String ' Set db = Current Db Set rst = db. icount = 0 Then Msg Box "You have not faxed these orders yet. Description & vb Cr Lf & " The date you entered may not be in a standard " & _ "format. This operation has been canceled" ' Resume exit_it ' Good_date: ' Set wksp = DBEngine.
Please download Looping Through A Recordset Recordsets have two important properties when looping through data, EOF (End-Of-File) and BOF (Beginning-Of-File).
Recordsets are like tables and when you loop through one, you are literally moving from record to record in sequence.