A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Reporting from a query using a counter



 
 
Thread Tools Display Modes
  #1  
Old December 1st, 2005, 03:10 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Reporting from a query using a counter

I have to write a report that will add on 10% to each line for the first 250
records and then 5% for the remainder of the report.

I have managed to cobble something together using VB code against the report
but wondered whether there was a better way.

It is possible in a query to have a record number against each row?

So that as the query displays its records the record count starts at 1 and
increments by one for each record displayed

thanks all

jON


  #2  
Old December 1st, 2005, 03:19 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Reporting from a query using a counter

Since you are reporting your results, you can add a text box to your detail
section:
Name: txtRunSum
Control Source: =1
Running Sum: Over All
Then to add 10% to a field name [Quantity], add a text box:
Name: txtHuh
Control Source: =[Quantity] * IIf(txtRunSum=250,1.1,1.05)

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
I have to write a report that will add on 10% to each line for the first
250 records and then 5% for the remainder of the report.

I have managed to cobble something together using VB code against the
report but wondered whether there was a better way.

It is possible in a query to have a record number against each row?

So that as the query displays its records the record count starts at 1 and
increments by one for each record displayed

thanks all

jON




  #3  
Old December 1st, 2005, 06:51 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Reporting from a query using a counter

perfect thanks Duane, just out of interest, for other reasons I may want to
have a query with a record number ...

is it possible to do that?

thanks,

jON

"Duane Hookom" wrote in message
...
Since you are reporting your results, you can add a text box to your
detail section:
Name: txtRunSum
Control Source: =1
Running Sum: Over All
Then to add 10% to a field name [Quantity], add a text box:
Name: txtHuh
Control Source: =[Quantity] * IIf(txtRunSum=250,1.1,1.05)

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
I have to write a report that will add on 10% to each line for the first
250 records and then 5% for the remainder of the report.

I have managed to cobble something together using VB code against the
report but wondered whether there was a better way.

It is possible in a query to have a record number against each row?

So that as the query displays its records the record count starts at 1
and increments by one for each record displayed

thanks all

jON






  #4  
Old December 1st, 2005, 08:41 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Reporting from a query using a counter

Search the queries news group on "rank".

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
perfect thanks Duane, just out of interest, for other reasons I may want
to have a query with a record number ...

is it possible to do that?

thanks,

jON

"Duane Hookom" wrote in message
...
Since you are reporting your results, you can add a text box to your
detail section:
Name: txtRunSum
Control Source: =1
Running Sum: Over All
Then to add 10% to a field name [Quantity], add a text box:
Name: txtHuh
Control Source: =[Quantity] * IIf(txtRunSum=250,1.1,1.05)

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
I have to write a report that will add on 10% to each line for the first
250 records and then 5% for the remainder of the report.

I have managed to cobble something together using VB code against the
report but wondered whether there was a better way.

It is possible in a query to have a record number against each row?

So that as the query displays its records the record count starts at 1
and increments by one for each record displayed

thanks all

jON








  #5  
Old December 2nd, 2005, 08:45 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Reporting from a query using a counter

Because my data set is in natural order, I don't think that I am not going
to be able to use a RANK

I have incorporated your running source which works fine.

Tell me though Duane, how do I sum txtHuh as in your example below?

If i have a total with a source of :

=sum([Quantity] * IIf(txtRunSum=250,1.1,1.05))

I am prompted for a value for txtRunSum

if I use

=sum(txtHuh)

Access changes it to


=sum([txtHuh])

And as that is not a field on my query this refuses to work???

jON


"Duane Hookom" wrote in message
...
Search the queries news group on "rank".

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
perfect thanks Duane, just out of interest, for other reasons I may want
to have a query with a record number ...

is it possible to do that?

thanks,

jON

"Duane Hookom" wrote in message
...
Since you are reporting your results, you can add a text box to your
detail section:
Name: txtRunSum
Control Source: =1
Running Sum: Over All
Then to add 10% to a field name [Quantity], add a text box:
Name: txtHuh
Control Source: =[Quantity] * IIf(txtRunSum=250,1.1,1.05)

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
I have to write a report that will add on 10% to each line for the first
250 records and then 5% for the remainder of the report.

I have managed to cobble something together using VB code against the
report but wondered whether there was a better way.

It is possible in a query to have a record number against each row?

So that as the query displays its records the record count starts at 1
and increments by one for each record displayed

thanks all

jON










  #6  
Old December 2nd, 2005, 03:31 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Reporting from a query using a counter

To Sum() txtHuh, you must copy the text box and set a Running Sum of it Over
All. Then reference the new text box in the report footer:

=txtHuhRunSum

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
Because my data set is in natural order, I don't think that I am not going
to be able to use a RANK

I have incorporated your running source which works fine.

Tell me though Duane, how do I sum txtHuh as in your example below?

If i have a total with a source of :

=sum([Quantity] * IIf(txtRunSum=250,1.1,1.05))

I am prompted for a value for txtRunSum

if I use

=sum(txtHuh)

Access changes it to


=sum([txtHuh])

And as that is not a field on my query this refuses to work???

jON


"Duane Hookom" wrote in message
...
Search the queries news group on "rank".

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
perfect thanks Duane, just out of interest, for other reasons I may want
to have a query with a record number ...

is it possible to do that?

thanks,

jON

"Duane Hookom" wrote in message
...
Since you are reporting your results, you can add a text box to your
detail section:
Name: txtRunSum
Control Source: =1
Running Sum: Over All
Then to add 10% to a field name [Quantity], add a text box:
Name: txtHuh
Control Source: =[Quantity] * IIf(txtRunSum=250,1.1,1.05)

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
I have to write a report that will add on 10% to each line for the
first 250 records and then 5% for the remainder of the report.

I have managed to cobble something together using VB code against the
report but wondered whether there was a better way.

It is possible in a query to have a record number against each row?

So that as the query displays its records the record count starts at 1
and increments by one for each record displayed

thanks all

jON












  #7  
Old December 2nd, 2005, 07:34 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Reporting from a query using a counter

so is there a way to make the running sum text box invisible? Width of zero
I guess?

cheers Duane.

jON

"Duane Hookom" wrote in message
...
To Sum() txtHuh, you must copy the text box and set a Running Sum of it
Over All. Then reference the new text box in the report footer:

=txtHuhRunSum

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
Because my data set is in natural order, I don't think that I am not
going to be able to use a RANK

I have incorporated your running source which works fine.

Tell me though Duane, how do I sum txtHuh as in your example below?

If i have a total with a source of :

=sum([Quantity] * IIf(txtRunSum=250,1.1,1.05))

I am prompted for a value for txtRunSum

if I use

=sum(txtHuh)

Access changes it to


=sum([txtHuh])

And as that is not a field on my query this refuses to work???

jON


"Duane Hookom" wrote in message
...
Search the queries news group on "rank".

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
perfect thanks Duane, just out of interest, for other reasons I may
want to have a query with a record number ...

is it possible to do that?

thanks,

jON

"Duane Hookom" wrote in message
...
Since you are reporting your results, you can add a text box to your
detail section:
Name: txtRunSum
Control Source: =1
Running Sum: Over All
Then to add 10% to a field name [Quantity], add a text box:
Name: txtHuh
Control Source: =[Quantity] * IIf(txtRunSum=250,1.1,1.05)

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
I have to write a report that will add on 10% to each line for the
first 250 records and then 5% for the remainder of the report.

I have managed to cobble something together using VB code against the
report but wondered whether there was a better way.

It is possible in a query to have a record number against each row?

So that as the query displays its records the record count starts at
1 and increments by one for each record displayed

thanks all

jON














  #8  
Old December 2nd, 2005, 08:00 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Reporting from a query using a counter

If I copy my text box to another one in the detail section and call it
"TextBoxRunSum" and set running sum thats fine.

But when I try to reference it in my footer

=textboxrunsum

gets converted to

=[textboxrunsum]

There is no fields called with this name and prompts me for avalue

If I just enter

textboxrunsum

it prompts for a value ????

I am now very confused???

jON

"Duane Hookom" wrote in message
...
To Sum() txtHuh, you must copy the text box and set a Running Sum of it
Over All. Then reference the new text box in the report footer:

=txtHuhRunSum

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
Because my data set is in natural order, I don't think that I am not
going to be able to use a RANK

I have incorporated your running source which works fine.

Tell me though Duane, how do I sum txtHuh as in your example below?

If i have a total with a source of :

=sum([Quantity] * IIf(txtRunSum=250,1.1,1.05))

I am prompted for a value for txtRunSum

if I use

=sum(txtHuh)

Access changes it to


=sum([txtHuh])

And as that is not a field on my query this refuses to work???

jON


"Duane Hookom" wrote in message
...
Search the queries news group on "rank".

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
perfect thanks Duane, just out of interest, for other reasons I may
want to have a query with a record number ...

is it possible to do that?

thanks,

jON

"Duane Hookom" wrote in message
...
Since you are reporting your results, you can add a text box to your
detail section:
Name: txtRunSum
Control Source: =1
Running Sum: Over All
Then to add 10% to a field name [Quantity], add a text box:
Name: txtHuh
Control Source: =[Quantity] * IIf(txtRunSum=250,1.1,1.05)

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
I have to write a report that will add on 10% to each line for the
first 250 records and then 5% for the remainder of the report.

I have managed to cobble something together using VB code against the
report but wondered whether there was a better way.

It is possible in a query to have a record number against each row?

So that as the query displays its records the record count starts at
1 and increments by one for each record displayed

thanks all

jON














  #9  
Old December 2nd, 2005, 09:24 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Reporting from a query using a counter

The addition of the [ ]s is normal. Confirm the correct name of the text box
by copying and paste the value from the Name to the Control Source. Make
sure your "total" text box is in the Report Footer section.

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
If I copy my text box to another one in the detail section and call it
"TextBoxRunSum" and set running sum thats fine.

But when I try to reference it in my footer

=textboxrunsum

gets converted to

=[textboxrunsum]

There is no fields called with this name and prompts me for avalue

If I just enter

textboxrunsum

it prompts for a value ????

I am now very confused???

jON

"Duane Hookom" wrote in message
...
To Sum() txtHuh, you must copy the text box and set a Running Sum of it
Over All. Then reference the new text box in the report footer:

=txtHuhRunSum

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
Because my data set is in natural order, I don't think that I am not
going to be able to use a RANK

I have incorporated your running source which works fine.

Tell me though Duane, how do I sum txtHuh as in your example below?

If i have a total with a source of :

=sum([Quantity] * IIf(txtRunSum=250,1.1,1.05))

I am prompted for a value for txtRunSum

if I use

=sum(txtHuh)

Access changes it to


=sum([txtHuh])

And as that is not a field on my query this refuses to work???

jON


"Duane Hookom" wrote in message
...
Search the queries news group on "rank".

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
perfect thanks Duane, just out of interest, for other reasons I may
want to have a query with a record number ...

is it possible to do that?

thanks,

jON

"Duane Hookom" wrote in message
...
Since you are reporting your results, you can add a text box to your
detail section:
Name: txtRunSum
Control Source: =1
Running Sum: Over All
Then to add 10% to a field name [Quantity], add a text box:
Name: txtHuh
Control Source: =[Quantity] * IIf(txtRunSum=250,1.1,1.05)

--
Duane Hookom
MS Access MVP
--

"Jon Rowlan" wrote in message
...
I have to write a report that will add on 10% to each line for the
first 250 records and then 5% for the remainder of the report.

I have managed to cobble something together using VB code against
the report but wondered whether there was a better way.

It is possible in a query to have a record number against each row?

So that as the query displays its records the record count starts at
1 and increments by one for each record displayed

thanks all

jON
















 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AHHHH-Get Data from Multiple Excel workbooks JAA149 General Discussion 5 October 30th, 2005 05:19 PM
Moving from xBase/Clipper [email protected] New Users 1 February 3rd, 2005 07:25 PM
adding 2 fields including null entries Jesse Running & Setting Up Queries 26 January 18th, 2005 05:31 PM
Too Few Parameters error Mail Merge Access Parameter Query Tony_VBACoder Mailmerge 3 September 14th, 2004 12:15 PM
Hidden files in Ms-Query cause ODBC connect errors or Query is wac needyourhelp General Discussion 4 July 12th, 2004 09:38 PM


All times are GMT +1. The time now is 02:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.