View Full Version : When query returns no records in set


bonesy
07-29-2007, 12:15 AM
I hope this doesn't sound too simple for this forum, I'm only a newbie!
I have a select query that will display the recordset that meets the criteria (OK I know that's not a big deal) but...I want to know if, when there are no records that meet the criteria, can I open a form (dialog box maybe) that will say there are no records found instead of showing a blank recordset. Once again I hope this is not so blindingly obvious that I have to start watching my coffee intake

Thanks in advance

boblarson
07-29-2007, 12:28 AM
Look into using a DCount (see the Access VBA help file for the syntax) to see if any records exist for that query and if there are you can open the query and if not you can return a message box telling the user that there are no records. You probably should be using a form to display the records instead of the query directly. You have more control over things that way.

bonesy
07-29-2007, 12:44 AM
Thank you, I was going to use a form for the display of the records, will look into the DCount function