By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,896 Members | 1,997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,896 IT Pros & Developers. It's quick & easy.

Reports....another question!

P: n/a
Right...
Using a cross-tab query I now have a way of getting the data in the form I
want it -(thanks for that Scott!), only thing now is that I can't find a
suitable way of making it into a report....I Can get a report but if I then
add more dates they arn't shown in the report, only the ones that were in
the database when the report was made. Is there a simple way of 'updating' a
report to add these changes???

--
Chris Naylor
*Cut the nonsense to reply*
"If you don't want to use the army, I should like to borrow it for a while.
Yours Respectfully, A. Lincoln"- Abraham Lincoln - letter to General George
B. McClellan during the Civil War.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.530 / Virus Database: 325 - Release Date: 22/10/2003
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Yes, this can be done in Access reports, but you will need to use VBA code. The caveat is
that you need some mechanism of limiting the number of columns in the crosstab query
result, in order to ensure that you can fit the results onto a page neatly. I have an
example that I will send to you.

Tom
_______________________________________________

"Chris Naylor" <ne**********@pobice.com> wrote in message
news:bn************@ID-155350.news.uni-berlin.de...

Right...
Using a cross-tab query I now have a way of getting the data in the form I
want it -(thanks for that Scott!), only thing now is that I can't find a
suitable way of making it into a report....I Can get a report but if I then
add more dates they arn't shown in the report, only the ones that were in
the database when the report was made. Is there a simple way of 'updating' a
report to add these changes???

--
Chris Naylor
*Cut the nonsense to reply*
"If you don't want to use the army, I should like to borrow it for a while.
Yours Respectfully, A. Lincoln"- Abraham Lincoln - letter to General George
B. McClellan during the Civil War.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.530 / Virus Database: 325 - Release Date: 22/10/2003

Nov 12 '05 #2

P: n/a
Tom Wickerath wrote:
Yes, this can be done in Access reports, but you will need to use VBA
code. The caveat is that you need some mechanism of limiting the
number of columns in the crosstab query result, in order to ensure
that you can fit the results onto a page neatly. I have an example
that I will send to you.

Tom


Hi!

Have received your example file and set my report up the same way as you
have done (apart from changing file names etc), but when I open the report
(run teh VBA coding) it comes up with a compile error for the 'dim'
statements in the sub Report_Open.

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim qdf As DAO.QueryDef
Dim i As Integer
Dim j As Integer
Dim intColCount As Integer
Dim strName As String
Dim s1 As String

When it gets to the 'Dim db As DAO.Database' line it brings up the error
message 'Compile Error: User-defined type not defined'. How can I define the
type, or failing that get arounf the error?

ANy help appreciated!

--
Chris Naylor
*Cut the nonsense to reply*
"Those are my principles. If you don't like them I have others."- Groucho
Marx
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.530 / Virus Database: 325 - Release Date: 22/10/2003
Nov 12 '05 #3

P: n/a
Hi Chris,

Compare the checked references in my sample database with those in your database. Access
2000 does not include a reference by default to the DAO 3.6 Object Library. Since this
code uses DAO, you will need a reference to this library. This library was included as a
default in Access 97 (and I believe earlier versions as well).

When viewing the code behind the report, click on Tools > References. Scroll down the
list until you find this library, and then select it. You can probably deselect the
default reference to the ADO library while you are at it, unless you know for sure that
you are using ADO code. Click on OK to dismiss this dialog. Finally, try clicking on
Debug > Compile to make sure you can compile the code correctly.

Tom
____________________________________________

Hi!

Have received your example file and set my report up the same way as you
have done (apart from changing file names etc), but when I open the report
(run teh VBA coding) it comes up with a compile error for the 'dim'
statements in the sub Report_Open.

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim qdf As DAO.QueryDef
Dim i As Integer
Dim j As Integer
Dim intColCount As Integer
Dim strName As String
Dim s1 As String

When it gets to the 'Dim db As DAO.Database' line it brings up the error
message 'Compile Error: User-defined type not defined'. How can I define the
type, or failing that get arounf the error?

ANy help appreciated!

--
Chris Naylor
Nov 12 '05 #4

P: n/a
Tom Wickerath wrote:
Hi Chris,

Compare the checked references in my sample database with those in
your database. Access 2000 does not include a reference by default
to the DAO 3.6 Object Library. Since this code uses DAO, you will
need a reference to this library. This library was included as a
default in Access 97 (and I believe earlier versions as well).

When viewing the code behind the report, click on Tools > References.
Scroll down the list until you find this library, and then select it.
You can probably deselect the default reference to the ADO library
while you are at it, unless you know for sure that you are using ADO
code. Click on OK to dismiss this dialog. Finally, try clicking on
Debug > Compile to make sure you can compile the code correctly.

Tom

Thankyou very much (yet again!). This has solved my problem now and I have a
working report (thanks).
I'd looked in the references but had been unable to find the DAO library -
that was until I compared it with yours (as suggested) and realised that it
was 'Microsoft DAO 3.6 object library' and not the 'DAO 3.6 library' that I
was hunting for!

Thanks once again
--
Chris Naylor
*Cut the nonsense to reply*
FEED THE HOMELESS, TO THE HUNGRY


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.530 / Virus Database: 325 - Release Date: 22/10/2003
Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.