?
Solved

ON No Data and form

Posted on 2011-02-15
2
Medium Priority
?
360 Views
Last Modified: 2012-05-11
Experts, I do not see an On No Data event for forms.   I need a msgbox that appears if no data much like the ON No Data Event for reports.

thank you
0
Comment
Question by:pdvsa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 2000 total points
ID: 34896499
...much like the ON No Data Event for reports....

What you do if there is no data in a report is up to you as the developer.  There is no fixed outcome.

In a form, you can test the size of the recordset and certainly pop up a msgbox as you have indicated.

In the form load event procedure..

if me.recordsetclone.recordcount = 0 then
msgbox "There is no current data to display in this form"
else
' do nothing
end if
0
 

Author Closing Comment

by:pdvsa
ID: 34898106
thank you...it worked perfectly.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question