If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How do I report no data found in query, other than a blank page?
I am writting a general query builder and need to report to the user that
their query did not return any records. Just a blank piece of paper in not acceptable. |
#2
|
|||
|
|||
How do I report no data found in query, other than a blank page?
You may want to put a function behind your form ....
(untested but it would be similar) Private Sub myReport OnLoad() If myRS.EOF Then MsgBox "There were no results for this query. Please try again with more data" DoCmd.Close acReport, "MyReport" End If End Sub hth |
#3
|
|||
|
|||
How do I report no data found in query, other than a blank page?
Or, use the OnNoData event of the report.
Private Sub Report_NoData(Cancel As Integer) MsgBox "This report contains no data" Cancel = True End Sub You might get an error on the line of code that you used to open the report. Chris Nebinger |
#4
|
|||
|
|||
How do I report no data found in query, other than a blank page?
You can also (depending on you application), catch the error before the
report is run by checking the query for records: If (CurrentDb.OpenRecordset("Query2").RecordCount = 0) Then MsgBox ("There are no records available") Else open query or report End If -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...arted/200601/1 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PST file has reached maximum size | Jeff C | General Discussion | 2 | October 6th, 2005 01:35 PM |
How do I save an access document in word document? | cmartin | General Discussion | 2 | September 13th, 2005 11:26 PM |
Error when running Query, but not Report | Blaze | Running & Setting Up Queries | 29 | September 9th, 2005 05:40 AM |
Still Hoping for help with a Query problem | Don Sealer | Using Forms | 15 | November 13th, 2004 06:24 AM |
Union Query Not Returning A Value | Jeff G | Running & Setting Up Queries | 2 | October 19th, 2004 05:47 PM |