Problem with control pulling wrong data

JasonM

Registered User.
Local time
Yesterday, 18:15
Joined
Jun 3, 2011
Messages
11
I have a funny problem that I have not experienced previously and I cannot seem to find a work around (at least an easy one). Perhaps someone here has seen something similar.
I am using the following control source for a text box on a report: =nz([Raw_Turb], "---")
When I do, it pulls data from a different field from the data source. I am pulling the data directly from the data table. I have tried creating a query and get similar results only from a different data field!
I have tried the same control source on a different report and it works correctly! Why does it not work on the current report? Can a report become corrupted somehow?
I can re-create the entire report, but am hesitant to do so... Any advice would be greatly appreciated. Screen caps are attached.
Thanks, Jm
 

Attachments

  • NoNz.jpg
    NoNz.jpg
    29.9 KB · Views: 125
  • NoWNz.jpg
    NoWNz.jpg
    39.2 KB · Views: 96
I suppose it could be some corruption??
The recordsource of the report is definitely your table?

When I do, it pulls data from a different field from the data source.

Since we don't know your data, what exactly is it pulling and what exactly are you requesting?
 
I suppose it could be some corruption??
The recordsource of the report is definitely your table?



Since we don't know your data, what exactly is it pulling and what exactly are you requesting?
Thank you very much for your reply!

I guess what I am looking for is confirmation that the function used: nz([FieldName],"---") should not cause a problem when used as a control source.
It looks like the the data is from another field in the record set.

I have checked and double checked the record source and it is correct, but that being said, the controls in question were cut and pasted from another report with the came record source. I have tried deleting several of the controls and recreating them, but I get the same results.

Have you ever seen anything like this?

The data table that the report pulls from is a simple flat table with only 24 records, one for each hour of the day. Without the nz function the control pulls the correct data. I added nz so that I could display null values as ---.
 
I haven't done much with reports for a long time (years).

What if you make a query based on your table, and put the
Nz(...) in the query and use the query as record source?

More of a guess than anything.

You may have to copy your current report, the change the recordsource. I don't want you to change the original and lose what you have already done.
 
As a workaround, there is a Format property alternative that also handles positive, negative, zero and Null on numeric fields.

The first term is for positive, the second is for negative, the third for zero and the fourth for Null. In your case it would be:

Code:
;;;"---"
 
Jdraw, thanks for the feedback. I had started the query, but that also seemed like a lot of duplicated effort.
I really appreciate the input though!
I think I will try Galaxiom's suggestion below. If that does not work, I will recreate the entire report. If that still doesn't get it I will go back to the Query.

Fingers crossed!
Cheers to you both.
 

Users who are viewing this thread

Back
Top Bottom