Printing a Report

  • Thread starter Thread starter Sara
  • Start date Start date
S

Sara

I have a database that I have designed in which one of the
fields is a quantity sold. This quantity sold is one
number but in the report I want it to show as several.
For example if the quantity sold = 27. I want the report
to show 1, 2, 3, ..., 26, 27. I know that this is
possible it is some type of sequence or series and yet I
cannot find the expression that I need to use.

Is there someone who has done this before? Do I need to
program this using the VB code or is this a simple
expression that I need to add to the report? Can someone
help?

Thanks
Sara
 
If you want the numbers all in a single text box, you could write code in
the On Format event of the section containing the QuantitySold field.
Assuming you have a text box "txtQtysSold". I would create a generic
function in a standard module:
Function ShowQtys(pintQty as Integer) as String
Dim strQty as String
Dim intI as Integer
For intI = 1 to pintQty
strQty = strQty & intI & ", "
Next
'remove the last ", "
If Len(strQty) > 0 Then
strQty = Left(strQty, Len(strQty)-2)
End If
ShowQtys = strQty
End

Set the control source property of txtQtysSold to
=ShowQtys([QuantitySold])
 
Thanks for your help. However, the problem is that I do
not want it all in a single text box. I want it to insert
a number for each report showing multiple on the report.
For example:

If Company X purchases a permit Y with 27 inspections.
Then the report would be as follows.

Company x permit Y Inspection 1
Company x permit Y Inspection 2
Company x permit Y Inspection 3
Company x permit Y Inspection ...
Company x permit Y Inspection 26
Company x permit Y Inspection 27

Please Help.

Thanks
Sara
-----Original Message-----
If you want the numbers all in a single text box, you could write code in
the On Format event of the section containing the QuantitySold field.
Assuming you have a text box "txtQtysSold". I would create a generic
function in a standard module:
Function ShowQtys(pintQty as Integer) as String
Dim strQty as String
Dim intI as Integer
For intI = 1 to pintQty
strQty = strQty & intI & ", "
Next
'remove the last ", "
If Len(strQty) > 0 Then
strQty = Left(strQty, Len(strQty)-2)
End If
ShowQtys = strQty
End

Set the control source property of txtQtysSold to
=ShowQtys([QuantitySold])

--
Duane Hookom
Microsoft Access MVP


Sara said:
I have a database that I have designed in which one of the
fields is a quantity sold. This quantity sold is one
number but in the report I want it to show as several.
For example if the quantity sold = 27. I want the report
to show 1, 2, 3, ..., 26, 27. I know that this is
possible it is some type of sequence or series and yet I
cannot find the expression that I need to use.

Is there someone who has done this before? Do I need to
program this using the VB code or is this a simple
expression that I need to add to the report? Can someone
help?

Thanks
Sara


.
 
Create a table of numbers "tblNums" with a single integer field "Num". Add
enough number records to the table to meet your max quantity:
1
2
3
4
...
X
Then, add this table to your report's record source. Add the Num field to
the query grid and set its criteria to:
<=[QuantitySold]
This will create X number of identical records that you can display in the
detail section of your report. Move other controls to various header and
footer sections.

--
Duane Hookom
Microsoft Access MVP


Sara said:
Thanks for your help. However, the problem is that I do
not want it all in a single text box. I want it to insert
a number for each report showing multiple on the report.
For example:

If Company X purchases a permit Y with 27 inspections.
Then the report would be as follows.

Company x permit Y Inspection 1
Company x permit Y Inspection 2
Company x permit Y Inspection 3
Company x permit Y Inspection ...
Company x permit Y Inspection 26
Company x permit Y Inspection 27

Please Help.

Thanks
Sara
-----Original Message-----
If you want the numbers all in a single text box, you could write code in
the On Format event of the section containing the QuantitySold field.
Assuming you have a text box "txtQtysSold". I would create a generic
function in a standard module:
Function ShowQtys(pintQty as Integer) as String
Dim strQty as String
Dim intI as Integer
For intI = 1 to pintQty
strQty = strQty & intI & ", "
Next
'remove the last ", "
If Len(strQty) > 0 Then
strQty = Left(strQty, Len(strQty)-2)
End If
ShowQtys = strQty
End

Set the control source property of txtQtysSold to
=ShowQtys([QuantitySold])

--
Duane Hookom
Microsoft Access MVP


Sara said:
I have a database that I have designed in which one of the
fields is a quantity sold. This quantity sold is one
number but in the report I want it to show as several.
For example if the quantity sold = 27. I want the report
to show 1, 2, 3, ..., 26, 27. I know that this is
possible it is some type of sequence or series and yet I
cannot find the expression that I need to use.

Is there someone who has done this before? Do I need to
program this using the VB code or is this a simple
expression that I need to add to the report? Can someone
help?

Thanks
Sara


.
 
That works great, Thanks. However, now I get 47 little
reports but they are not displaying 1,2,3,...,46,47. They
are all displaying the one number 47. Is it possible to
show the different numbers 1, 2 ,3 etc...

Sara
-----Original Message-----
Create a table of numbers "tblNums" with a single integer field "Num". Add
enough number records to the table to meet your max quantity:
1
2
3
4
...
X
Then, add this table to your report's record source. Add the Num field to
the query grid and set its criteria to:
<=[QuantitySold]
This will create X number of identical records that you can display in the
detail section of your report. Move other controls to various header and
footer sections.

--
Duane Hookom
Microsoft Access MVP


Sara said:
Thanks for your help. However, the problem is that I do
not want it all in a single text box. I want it to insert
a number for each report showing multiple on the report.
For example:

If Company X purchases a permit Y with 27 inspections.
Then the report would be as follows.

Company x permit Y Inspection 1
Company x permit Y Inspection 2
Company x permit Y Inspection 3
Company x permit Y Inspection ...
Company x permit Y Inspection 26
Company x permit Y Inspection 27

Please Help.

Thanks
Sara
-----Original Message-----
If you want the numbers all in a single text box, you could write code in
the On Format event of the section containing the QuantitySold field.
Assuming you have a text box "txtQtysSold". I would create a generic
function in a standard module:
Function ShowQtys(pintQty as Integer) as String
Dim strQty as String
Dim intI as Integer
For intI = 1 to pintQty
strQty = strQty & intI & ", "
Next
'remove the last ", "
If Len(strQty) > 0 Then
strQty = Left(strQty, Len(strQty)-2)
End If
ShowQtys = strQty
End

Set the control source property of txtQtysSold to
=ShowQtys([QuantitySold])

--
Duane Hookom
Microsoft Access MVP


I have a database that I have designed in which one
of
the
fields is a quantity sold. This quantity sold is one
number but in the report I want it to show as several.
For example if the quantity sold = 27. I want the report
to show 1, 2, 3, ..., 26, 27. I know that this is
possible it is some type of sequence or series and yet I
cannot find the expression that I need to use.

Is there someone who has done this before? Do I need to
program this using the VB code or is this a simple
expression that I need to add to the report? Can someone
help?

Thanks
Sara


.


.
 
Did you include the [Num] field in your query? This will give you numbers
1 - 47.

--
Duane Hookom
Microsoft Access MVP


Sara said:
That works great, Thanks. However, now I get 47 little
reports but they are not displaying 1,2,3,...,46,47. They
are all displaying the one number 47. Is it possible to
show the different numbers 1, 2 ,3 etc...

Sara
-----Original Message-----
Create a table of numbers "tblNums" with a single integer field "Num". Add
enough number records to the table to meet your max quantity:
1
2
3
4
...
X
Then, add this table to your report's record source. Add the Num field to
the query grid and set its criteria to:
<=[QuantitySold]
This will create X number of identical records that you can display in the
detail section of your report. Move other controls to various header and
footer sections.

--
Duane Hookom
Microsoft Access MVP


Sara said:
Thanks for your help. However, the problem is that I do
not want it all in a single text box. I want it to insert
a number for each report showing multiple on the report.
For example:

If Company X purchases a permit Y with 27 inspections.
Then the report would be as follows.

Company x permit Y Inspection 1
Company x permit Y Inspection 2
Company x permit Y Inspection 3
Company x permit Y Inspection ...
Company x permit Y Inspection 26
Company x permit Y Inspection 27

Please Help.

Thanks
Sara

-----Original Message-----
If you want the numbers all in a single text box, you
could write code in
the On Format event of the section containing the
QuantitySold field.
Assuming you have a text box "txtQtysSold". I would
create a generic
function in a standard module:
Function ShowQtys(pintQty as Integer) as String
Dim strQty as String
Dim intI as Integer
For intI = 1 to pintQty
strQty = strQty & intI & ", "
Next
'remove the last ", "
If Len(strQty) > 0 Then
strQty = Left(strQty, Len(strQty)-2)
End If
ShowQtys = strQty
End

Set the control source property of txtQtysSold to
=ShowQtys([QuantitySold])

--
Duane Hookom
Microsoft Access MVP


I have a database that I have designed in which one of
the
fields is a quantity sold. This quantity sold is one
number but in the report I want it to show as several.
For example if the quantity sold = 27. I want the
report
to show 1, 2, 3, ..., 26, 27. I know that this is
possible it is some type of sequence or series and yet I
cannot find the expression that I need to use.

Is there someone who has done this before? Do I need to
program this using the VB code or is this a simple
expression that I need to add to the report? Can
someone
help?

Thanks
Sara


.


.
 
Back
Top