Re: Msgbox if query no result displayed

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: MsgBoxIfNoData (anonymous_at_discussions.microsoft.com)
Date: 11/05/04


Date: Thu, 4 Nov 2004 22:59:01 -0800

As first, thank You for your kindness.
I have Select Query based on table. The Query fills
subform-Child. There are 2 columns in this subform.
On the main form I have textbox with sum of second column
in subform.
In case that there is no data, I want to display msgbox to
inform that sum/total of one column is 0 (currency).
But, how should I express something like:
If query result has no data, then sum of column is zero.
I want to write code but how to express qery result?

(sory about my english I'm trying)

>-----Original Message-----
>How are you "opening" the query? What is the use of the
query: form
>recordsource? report recordsource? something else?
>
>To do what you want, you will have to use VBA code or
macro to test whether
>the query will return any records, or some other similar
process. Post more
>details, please, about what you're doing.
>
>--
>
> Ken Snell
><MS ACCESS MVP>
>
>"MsgBoxIfNoData" <anonymous@discussions.microsoft.com>
wrote in message
>news:2f3d01c4c278$a3cbc100$a401280a@phx.gbl...
>> Hi,
>> I would like to display msgbox ("No data or no result")
if
>> my query don't find any data.
>> How to write this code?
>> I tried with If is null...but can't find any solution..
>> Who will help me?
>> Any help welcome.
>> Thanx
>
>
>.
>



Relevant Pages

  • Re: Access 2003 Forms and Subforms with Parameter Query
    ... If RecordSource = "" Then ... <MS ACCESS MVP> ... subform to open the parameter query (or to pass along the recordset ... the "onclick" event for the button to run the query ...
    (microsoft.public.access.formscoding)
  • RE: Crosstab Worries
    ... I copied your sql into my Northwind and I created a form off that query and I ... concerned, the recordsource is three letters, Jan, Feb, but the text box is ... You can sum a field from the record source but not ... with their totals in each of the twelve columns. ...
    (microsoft.public.access.queries)
  • Want to set parameter in code for recordsource
    ... I have a subform, and the RecordSource of the subform is ... a query that contains a parameter. ... The link master/link child properties don't solve my ...
    (microsoft.public.access.formscoding)
  • RecordSource parameters
    ... I have a subform, and the ... RecordSource of the subform is a query that contains a ... The link master/link child properties don't solve my ... union query, and performance is unacceptable when I rely ...
    (microsoft.public.access.formscoding)
  • Can recordsource parameters be set in code?
    ... I have a subform, and the ... RecordSource of the subform is a query that contains a ... The link master/link child properties don't solve my ... union query, and performance is unacceptable when I rely ...
    (microsoft.public.access.forms)