Problems Displaying Data in My Reports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am having problems with this code which does not want to work in a text
box of my report
"CompanyAVisits Query" is the query the report is based upon.
Field Names as follows:
[Unit] text field
[VisitType] LookUp Field to show "Full", "Flash", "Ad Hoc" or "Investigation"
The report works with no problems it is only when I try to sum up the .
However when I want to report on how many "Full" or "Flash" visits have been
totaled on the report I get 'Error#' in my text box where these functions
are. The text boxes are in the report footer

=DCount("[Unit]","CompanyAVisits Query","[VisitType] = 'Full'")
And
=DSum("Cost","CompanyAVisit Query","[Divisions] = 'Entertainment'")

Regards,

Graeme.
 
Jurrasicway said:
Hi,
I am having problems with this code which does not want to work in a text
box of my report
"CompanyAVisits Query" is the query the report is based upon.
Field Names as follows:
[Unit] text field
[VisitType] LookUp Field to show "Full", "Flash", "Ad Hoc" or "Investigation"
The report works with no problems it is only when I try to sum up the .
However when I want to report on how many "Full" or "Flash" visits have been
totaled on the report I get 'Error#' in my text box where these functions
are. The text boxes are in the report footer

=DCount("[Unit]","CompanyAVisits Query","[VisitType] = 'Full'")
And
=DSum("Cost","CompanyAVisit Query","[Divisions] = 'Entertainment'")

Regards,

Graeme.

Try enclosing your domain recordsource in [ ]. You've got a space in the
name of your query. You might consider also renaming your objects using
a prefix notation such as qryCompanyAVisits, which is the more common
practice.

Check out this link on the Leszynski/Reddick Naming guidelines
(http://www.mvps.org/access/general/gen0012.htm), or do a search for
Microsoft Access naming conventions.

=DCount("[Unit]","[CompanyAVisits Query]","[VisitType] = 'Full'")

Assuming that VisitType is a string, which you said it is, this should work.

As far as database design goes, you might consider normalizing it a bit
further, and storing VisitType as a number, which has a relationship to
a lookup table of tlkpVisitTypes. This allows you to later rename your
Visit Types, add additional ones, base combo box lookups on the table
and have their qty of records increase. Hardcoding string values like
that can be limiting.
 
Hi,

I have now enclosed them in [] and the report still does not work. I can not
work it out. I have two "D" conditions in Text Boxes and both do not work on
my report. I first thought that it could be because one was linked to a
lookup field that will be difined as a number field with text stored in it
[VisitType] so I put in the other condition to test this, but it does the same

=DCount("[Unit]","[CompanyAVisits Query]","[VisitType] = 'Full'")
And
=DSum("[Cost]","[CompanyAVisit Query]","[Divisions] = 'Entertainment'")

Driving me mad. It should work but doesn't. Any other ideas?

Graeme.

Duncan Bachen said:
Jurrasicway said:
Hi,
I am having problems with this code which does not want to work in a text
box of my report
"CompanyAVisits Query" is the query the report is based upon.
Field Names as follows:
[Unit] text field
[VisitType] LookUp Field to show "Full", "Flash", "Ad Hoc" or "Investigation"
The report works with no problems it is only when I try to sum up the .
However when I want to report on how many "Full" or "Flash" visits have been
totaled on the report I get 'Error#' in my text box where these functions
are. The text boxes are in the report footer

=DCount("[Unit]","CompanyAVisits Query","[VisitType] = 'Full'")
And
=DSum("Cost","CompanyAVisit Query","[Divisions] = 'Entertainment'")

Regards,

Graeme.

Try enclosing your domain recordsource in [ ]. You've got a space in the
name of your query. You might consider also renaming your objects using
a prefix notation such as qryCompanyAVisits, which is the more common
practice.

Check out this link on the Leszynski/Reddick Naming guidelines
(http://www.mvps.org/access/general/gen0012.htm), or do a search for
Microsoft Access naming conventions.

=DCount("[Unit]","[CompanyAVisits Query]","[VisitType] = 'Full'")

Assuming that VisitType is a string, which you said it is, this should work.

As far as database design goes, you might consider normalizing it a bit
further, and storing VisitType as a number, which has a relationship to
a lookup table of tlkpVisitTypes. This allows you to later rename your
Visit Types, add additional ones, base combo box lookups on the table
and have their qty of records increase. Hardcoding string values like
that can be limiting.
 
Jurrasicway said:
Hi,

I have now enclosed them in [] and the report still does not work. I can not
work it out. I have two "D" conditions in Text Boxes and both do not work on
my report. I first thought that it could be because one was linked to a
lookup field that will be difined as a number field with text stored in it
[VisitType] so I put in the other condition to test this, but it does the same

=DCount("[Unit]","[CompanyAVisits Query]","[VisitType] = 'Full'")
And
=DSum("[Cost]","[CompanyAVisit Query]","[Divisions] = 'Entertainment'")

Driving me mad. It should work but doesn't. Any other ideas?

Graeme.

Your syntax is correct. The problem has to be with your datatypes or
your object names. I can't help with either of these, as you've
presented the information already and from you've said, it makes sense.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top