How Report is displayed when there are no records

  • Thread starter Thread starter Linda Ribbach
  • Start date Start date
L

Linda Ribbach

I have a report that displays dollars when recorded payments are on
hold. Everything was working great until there where no longer any
payments on hold.

Now the report displays the word "error" in all text boxes. The person
using this report wants $0.00 dollars and a title that states "there are
no items on Hold for this Acctg Period"

So, I created a clone of the original report. And Ithen I created
strings "$0.00" in the text boxes where the "ERROR" was. Then, in the
original report, on no data event, I set a macro to run which opens the
clone report. The problem was that the original report with the errors
remained on top and the clone was under it. I had to close the bad
report to display the clone.

Then I tried a "cancel event" in the macro after the clone report opens.
That worked when I launched the report from the database window, but
when I tried using the button, I got another error message.
This error message did not prevent the me from continuing and the clone
report opened.

But, I don't want the user to have to see an dialogue box error
everytime. There must be some simple solution to "no records". This is
not like null records.


Thanks in advance.


Linda
 
In the macro, that is triggered OnNoData Event, close the original report:
Action: Close
ObjectType: Report
ObjectName: "MyOriginalReport"

Now only the clone-report is open, ready to be printed.

Regards,

Jacques J.J. Soudan

www.troisj.com


I have a report that displays dollars when recorded payments are on
hold. Everything was working great until there where no longer any
payments on hold.

Now the report displays the word "error" in all text boxes. The person
using this report wants $0.00 dollars and a title that states "there are
no items on Hold for this Acctg Period"

So, I created a clone of the original report. And Ithen I created
strings "$0.00" in the text boxes where the "ERROR" was. Then, in the
original report, on no data event, I set a macro to run which opens the
clone report. The problem was that the original report with the errors
remained on top and the clone was under it. I had to close the bad
report to display the clone.

Then I tried a "cancel event" in the macro after the clone report opens.
That worked when I launched the report from the database window, but
when I tried using the button, I got another error message.
This error message did not prevent the me from continuing and the clone
report opened.

But, I don't want the user to have to see an dialogue box error
everytime. There must be some simple solution to "no records". This is
not like null records.


Thanks in advance.


Linda
 
Yuk, don't create extra reports. If you have a text box in your report
footer that is bound to an expression like:
=Sum([DollarsSquandered])
then change it to:
=IIf([HasData], Sum([DollarsSquandered]) , 0)
 
Thanks Duane,

Do have to do this for every text box on my report?

Linda


Duane Hookom said:
Yuk, don't create extra reports. If you have a text box in your report
footer that is bound to an expression like:
=Sum([DollarsSquandered])
then change it to:
=IIf([HasData], Sum([DollarsSquandered]) , 0)


--
Duane Hookom
MS Access MVP


Linda Ribbach said:
I have a report that displays dollars when recorded payments are on
hold. Everything was working great until there where no longer any
payments on hold.

Now the report displays the word "error" in all text boxes. The person
using this report wants $0.00 dollars and a title that states "there are
no items on Hold for this Acctg Period"

So, I created a clone of the original report. And Ithen I created
strings "$0.00" in the text boxes where the "ERROR" was. Then, in the
original report, on no data event, I set a macro to run which opens the
clone report. The problem was that the original report with the errors
remained on top and the clone was under it. I had to close the bad
report to display the clone.

Then I tried a "cancel event" in the macro after the clone report opens.
That worked when I launched the report from the database window, but
when I tried using the button, I got another error message.
This error message did not prevent the me from continuing and the clone
report opened.

But, I don't want the user to have to see an dialogue box error
everytime. There must be some simple solution to "no records". This is
not like null records.


Thanks in advance.


Linda
 
Yep. You can copy "IIf([HasData]," into the clipboard and then paste it
where needed.

--
Duane Hookom
MS Access MVP


Linda Ribbach said:
Thanks Duane,

Do have to do this for every text box on my report?

Linda


Duane Hookom said:
Yuk, don't create extra reports. If you have a text box in your report
footer that is bound to an expression like:
=Sum([DollarsSquandered])
then change it to:
=IIf([HasData], Sum([DollarsSquandered]) , 0)


--
Duane Hookom
MS Access MVP


Linda Ribbach said:
I have a report that displays dollars when recorded payments are on
hold. Everything was working great until there where no longer any
payments on hold.

Now the report displays the word "error" in all text boxes. The person
using this report wants $0.00 dollars and a title that states "there are
no items on Hold for this Acctg Period"

So, I created a clone of the original report. And Ithen I created
strings "$0.00" in the text boxes where the "ERROR" was. Then, in the
original report, on no data event, I set a macro to run which opens the
clone report. The problem was that the original report with the errors
remained on top and the clone was under it. I had to close the bad
report to display the clone.

Then I tried a "cancel event" in the macro after the clone report opens.
That worked when I launched the report from the database window, but
when I tried using the button, I got another error message.
This error message did not prevent the me from continuing and the clone
report opened.

But, I don't want the user to have to see an dialogue box error
everytime. There must be some simple solution to "no records". This is
not like null records.


Thanks in advance.


Linda
 
This worked so slickly. Is there a reference book with all these convenient
code in it? It's sure needed.

Linda
Duane Hookom said:
Yep. You can copy "IIf([HasData]," into the clipboard and then paste it
where needed.

--
Duane Hookom
MS Access MVP


Linda Ribbach said:
Thanks Duane,

Do have to do this for every text box on my report?

Linda


Duane Hookom said:
Yuk, don't create extra reports. If you have a text box in your report
footer that is bound to an expression like:
=Sum([DollarsSquandered])
then change it to:
=IIf([HasData], Sum([DollarsSquandered]) , 0)


--
Duane Hookom
MS Access MVP


I have a report that displays dollars when recorded payments are on
hold. Everything was working great until there where no longer any
payments on hold.

Now the report displays the word "error" in all text boxes. The person
using this report wants $0.00 dollars and a title that states "there are
no items on Hold for this Acctg Period"

So, I created a clone of the original report. And Ithen I created
strings "$0.00" in the text boxes where the "ERROR" was. Then, in the
original report, on no data event, I set a macro to run which opens the
clone report. The problem was that the original report with the errors
remained on top and the clone was under it. I had to close the bad
report to display the clone.

Then I tried a "cancel event" in the macro after the clone report opens.
That worked when I launched the report from the database window, but
when I tried using the button, I got another error message.
This error message did not prevent the me from continuing and the clone
report opened.

But, I don't want the user to have to see an dialogue box error
everytime. There must be some simple solution to "no records". This is
not like null records.


Thanks in advance.


Linda
 
I am not aware of any book with strickly tips. Glad you are getting this
sorted out.

--
Duane Hookom
MS Access MVP


Linda Ribbach said:
This worked so slickly. Is there a reference book with all these convenient
code in it? It's sure needed.

Linda
Duane Hookom said:
Yep. You can copy "IIf([HasData]," into the clipboard and then paste it
where needed.

--
Duane Hookom
MS Access MVP


Linda Ribbach said:
Thanks Duane,

Do have to do this for every text box on my report?

Linda


Yuk, don't create extra reports. If you have a text box in your report
footer that is bound to an expression like:
=Sum([DollarsSquandered])
then change it to:
=IIf([HasData], Sum([DollarsSquandered]) , 0)


--
Duane Hookom
MS Access MVP


I have a report that displays dollars when recorded payments are on
hold. Everything was working great until there where no longer any
payments on hold.

Now the report displays the word "error" in all text boxes. The person
using this report wants $0.00 dollars and a title that states
"there
are
no items on Hold for this Acctg Period"

So, I created a clone of the original report. And Ithen I created
strings "$0.00" in the text boxes where the "ERROR" was. Then, in the
original report, on no data event, I set a macro to run which
opens
the
clone report. The problem was that the original report with the errors
remained on top and the clone was under it. I had to close the bad
report to display the clone.

Then I tried a "cancel event" in the macro after the clone report opens.
That worked when I launched the report from the database window, but
when I tried using the button, I got another error message.
This error message did not prevent the me from continuing and the clone
report opened.

But, I don't want the user to have to see an dialogue box error
everytime. There must be some simple solution to "no records".
This
is
not like null records.


Thanks in advance.


Linda
 
Back
Top