473,405 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

If query has not records -"no records found" to be output in query out/report

I am currently running a marco that run a query and emails the results
as an attachment in excel format. If the query has no records, I would
like to email "no records found" in the first cell in the excel
attachment. I have a feeling that this needs to be done in VB, but I
don't know that much about VB. Would using a report instead be a
better and easier way of doing this?

Aug 23 '06 #1
1 2696
I would open the query in VBA and do a recordcount. If recordcount >
0, send the email. Otherwise, send "No records found".

scottmach...@cox.net wrote:
I am currently running a marco that run a query and emails the results
as an attachment in excel format. If the query has no records, I would
like to email "no records found" in the first cell in the excel
attachment. I have a feeling that this needs to be done in VB, but I
don't know that much about VB. Would using a report instead be a
better and easier way of doing this?
Aug 23 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ranga | last post by:
Hi, I am getting the following error when i am using query no in my sql statement and compiling the stored proc. I am doing this on Unic UDB DB2. Please let me know if i am mising something here....
8
by: Mark Kolber | last post by:
I have a table in a database that contains a text field. The text field contains identifiers that consist of 7 alphanumeric characters, such as GORKY, 99SST, and PT10A. I am trying to run a...
2
by: Jason | last post by:
I have a table of 650,000 records associated to contracts. Some of the contracts have multiple records but each contract only has one Active Record (there might be several inactive records). ...
2
by: Terry | last post by:
I have a database that I would like to query for a specific date range. I want to create a report based on this query that will pull any records from the last 7 days. Is this possible? Can...
2
by: WTG | last post by:
Hope someone can help I have records of fuel inventory, and I've used yes/no switches for the different types of fuel. ie: amount gas clear dyed 100 yes 56 yes 245 yes
1
by: owenmj | last post by:
I have a written a web service which takes some user input and then looks up the relevant details on a SQL server. All works fine until I embed it in the Research pane - at which point I receive...
0
by: robert.waters | last post by:
Hello, Say that there is a database for client information; there is a main form that displays the client's name, and this form has one or more subforms that display different types of...
2
by: ptah | last post by:
hello all, i have been trying to create a view using the select statement below: SELECT Case_CaseId, MIN(CASE WHEN case_stage = 'Logged' THEN Case_CreatedDate END) AS Logged, ...
11
by: cgrider | last post by:
I have a query that checks for duplicate records on 2 fields. the issue I am having is that the data unfortunately is case sensitive. So M != m but the query is case insensitive. Is there a way to...
1
by: yfangl09 | last post by:
I have one query with a list of people and required courses they have to take and another with the same people and courses they have already taken. How do I generate a query with required courses...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.