473,670 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2713
I would open the query in VBA and do a recordcount. If recordcount >
0, send the email. Otherwise, send "No records found".

scottmach...@co x.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
3820
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. ---------------------------Error Message -------------------------------------- Begin Customization of Profile: Profile name is: SP_DEL_TOTE_ITEM_SJProfile0 Failed to online-check the following statement:
8
4152
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 query that will only display those identifiers that have no numerical characters, so that, from the examples above, only GORKY will show. I apologize is this is an often-repeted request. I searched Google and Google Groups, but couldn't seem to...
2
2769
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). There are dates associated with each of the records (whether active or inactive). I need to compare the dates between the active and inactive contract records. So far, I've created a "find duplicates query" for contract to identify contracts that...
2
2134
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 someone tell me how it is done? Thanks.
2
1549
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
1352
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 no query text when I invoke the service I'm deploying the service on my local machine so is there an IIS setting that I have not set that stops the data being received? ..or is the code wrong?
0
1686
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 information related to that client. The main Form has RecordSource="SELECT clientid, clientname FROM client_table;", and each subform has both Link Child and Master Fields="clientid".
2
4826
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, MIN(CASE WHEN case_stage = 'Waiting' THEN Case_CreatedDate END) AS Waiting, MIN(CASE WHEN case_stage = 'Closed' THEN Case_CreatedDate END) AS Closed FROM
11
2409
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 make my query case sensitive so I can cancel out the False positives from the query? here is the quey if that helps SELECT tblPreReleaseData.From_Conn, tblPreReleaseData.From_term, tblPreReleaseData.Serial_number,...
1
1801
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 they have NOT taken? Anybody have any suggestions?
0
8466
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8591
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8659
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7412
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6212
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4388
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2799
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2037
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.