Counting on a Report

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

On the report the field [Notes] is set as hide duplicates
= YES.
Is there away to have a number like used in =1 to count up
each time [Notes] is printed?
i.e. of what is needed:
Notes Description
1 XXXX jfkjflkajflk
fjkaljflkajflk
jfaljfklajflkja
2 XXXXXX fjajfklajajkljakl
jflkajflkajflja;fl
jklfjlkajflajfjklf
kdajfkjal;fjkal
3 jjjjjjj kkfjaklfjlakfjla
kafjlkajfljalfjl;
Since There is no way to group by a field and not have it
sort by that field this seems to be my only option.
However, if the =1 is currently used, each line is
numbered.

Thank you for any and all help,

Paul
 
-----Original Message-----
Paul said:
On the report the field [Notes] is set as hide duplicates
= YES.
Is there away to have a number like used in =1 to count up
each time [Notes] is printed?
i.e. of what is needed:
Notes Description
1 XXXX jfkjflkajflk
fjkaljflkajflk
jfaljfklajflkja
2 XXXXXX fjajfklajajkljakl
jflkajflkajflja;fl
jklfjlkajflajfjklf
kdajfkjal;fjkal
3 jjjjjjj kkfjaklfjlakfjla
kafjlkajfljalfjl;
Since There is no way to group by a field and not have it
sort by that field this seems to be my only option.
However, if the =1 is currently used, each line is
numbered.

Change the Running Sum text box to use
an expression like:

=IIf([txtNotes].[IsVisible], 1, 0)

and set its HideDuplicates property to Yes.

Marsh,
First I tried the copy and paste the above, but the
report asked for parameter for txtNotes, so, since the
field is actually named [Notes] I changed the [txtNotes]
to [Notes]. But with no success. Now there is NO
numbering on the report. Here is what was the end result
of the new control source of the text box:
=IIf([Notes].[IsVisible],1,0)
With the text boxes' hide duplicate value set to YES

Any ideas as to what I am doing wrong?

Thanks again for any all help,

Paul
 
My guess is you did exactly the wrong change -- you likely have a Field and
a Control with the same name, and that can be "confusing". Try changing the
name of the Control that displays the Notes Field to txtNotes (and that
makes it easy to see at a glance that it is the name of a Text Box). Then if
it still does not work, follow up or clarify here in the newsgroup, not by
e-mail.

Larry Linson
Microsoft Access MVP


Paul said:
-----Original Message-----
Paul said:
On the report the field [Notes] is set as hide duplicates
= YES.
Is there away to have a number like used in =1 to count up
each time [Notes] is printed?
i.e. of what is needed:
Notes Description
1 XXXX jfkjflkajflk
fjkaljflkajflk
jfaljfklajflkja
2 XXXXXX fjajfklajajkljakl
jflkajflkajflja;fl
jklfjlkajflajfjklf
kdajfkjal;fjkal
3 jjjjjjj kkfjaklfjlakfjla
kafjlkajfljalfjl;
Since There is no way to group by a field and not have it
sort by that field this seems to be my only option.
However, if the =1 is currently used, each line is
numbered.

Change the Running Sum text box to use
an expression like:

=IIf([txtNotes].[IsVisible], 1, 0)

and set its HideDuplicates property to Yes.

Marsh,
First I tried the copy and paste the above, but the
report asked for parameter for txtNotes, so, since the
field is actually named [Notes] I changed the [txtNotes]
to [Notes]. But with no success. Now there is NO
numbering on the report. Here is what was the end result
of the new control source of the text box:
=IIf([Notes].[IsVisible],1,0)
With the text boxes' hide duplicate value set to YES

Any ideas as to what I am doing wrong?

Thanks again for any all help,

Paul
 
Paul said:
On the report the field [Notes] is set as hide duplicates
= YES.
Is there away to have a number like used in =1 to count up
each time [Notes] is printed?
i.e. of what is needed:
Notes Description
1 XXXX jfkjflkajflk
fjkaljflkajflk
jfaljfklajflkja
2 XXXXXX fjajfklajajkljakl
jflkajflkajflja;fl
jklfjlkajflajfjklf
kdajfkjal;fjkal
3 jjjjjjj kkfjaklfjlakfjla
kafjlkajfljalfjl;
Since There is no way to group by a field and not have it
sort by that field this seems to be my only option.
However, if the =1 is currently used, each line is
numbered.
Marshall said:
Change the Running Sum text box to use
an expression like:

=IIf([txtNotes].[IsVisible], 1, 0)

and set its HideDuplicates property to Yes.
Paul said:
First I tried the copy and paste the above, but the
report asked for parameter for txtNotes, so, since the
field is actually named [Notes] I changed the [txtNotes]
to [Notes]. But with no success. Now there is NO
numbering on the report. Here is what was the end result
of the new control source of the text box:
=IIf([Notes].[IsVisible],1,0)
With the text boxes' hide duplicate value set to YES

If Larry's suggestion doesn't help, then temporarily turn
off HideDuplicates for the counter text box. Maybe that
will provide a clue.
 
IT WORKED!!! You have no idea how long I have been working
on this report!!!!!!!

I do however have one more question:
Is there anyway to have a line read off the count fiels so
that only when the count is visible the line will be
visible?

Thank you ALL!!!!!!

Paul


Is there any way to have this field print whenever
txtNotes prints or is visible. I already tried =iif
([txtNotes].[IsVisible],[Project Classification
-----Original Message-----
My guess is you did exactly the wrong change -- you likely have a Field and
a Control with the same name, and that can
be "confusing". Try changing the
name of the Control that displays the Notes Field to txtNotes (and that
makes it easy to see at a glance that it is the name of a Text Box). Then if
it still does not work, follow up or clarify here in the newsgroup, not by
e-mail.

Larry Linson
Microsoft Access MVP


Paul said:
-----Original Message-----
Paul wrote:

On the report the field [Notes] is set as hide duplicates
= YES.
Is there away to have a number like used in =1 to
count
up
each time [Notes] is printed?
i.e. of what is needed:
Notes Description
1 XXXX jfkjflkajflk
fjkaljflkajflk
jfaljfklajflkja
2 XXXXXX fjajfklajajkljakl
jflkajflkajflja;fl
jklfjlkajflajfjklf
kdajfkjal;fjkal
3 jjjjjjj kkfjaklfjlakfjla
kafjlkajfljalfjl;
Since There is no way to group by a field and not have it
sort by that field this seems to be my only option.
However, if the =1 is currently used, each line is
numbered.

Change the Running Sum text box to use
an expression like:

=IIf([txtNotes].[IsVisible], 1, 0)

and set its HideDuplicates property to Yes.

Marsh,
First I tried the copy and paste the above, but the
report asked for parameter for txtNotes, so, since the
field is actually named [Notes] I changed the [txtNotes]
to [Notes]. But with no success. Now there is NO
numbering on the report. Here is what was the end result
of the new control source of the text box:
=IIf([Notes].[IsVisible],1,0)
With the text boxes' hide duplicate value set to YES

Any ideas as to what I am doing wrong?

Thanks again for any all help,

Paul


.
 
Paul said:
The (what I hope is the last item) is for a line to appear
above the count box each time it is visible. Access' help
feature provided me with:
If Me.Number(which is the name for the count
box).IsVisible Then
Me.Line0.Visible = True
Else
Me.Line0.Visible = False
End If

However I know this is not all that is needed. Currently
I have the following in the On Print Event of the detail
to provide the lines that make the columns so that they
will grow as the description and comments feilds grow. I
have set up X11, X12, Y11 and Y12 to form the new line for
above the count box however am unsure how to get it all
working together.
Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As
Integer)
Dim x1 As Single, Y1 As Single
Dim x2 As Single, Y2 As Single
Dim X3 As Single, Y3 As Single
Dim X4 As Single, Y4 As Single
Dim X5 As Single, Y5 As Single
Dim X6 As Single, Y6 As Single
Dim X7 As Single, Y7 As Single
Dim X8 As Single, Y8 As Single
Dim X9 As Single, Y9 As Single
Dim X10 As Single, Y10 As Single
'Dim X11 As Single, Y11 As Single
'Dim X12 As Single, Y12 As Single


Dim Color As Long

Me.ScaleMode = 5

x1 = 7.915
x2 = 7.915
X3 = 8.54
X4 = 8.54
X5 = 9.21
X6 = 9.21
X7 = 9.875
X8 = 9.875
X9 = 10.5
X10 = 10.5
'X11 = 0
'X12 = 0

Y1 = 0
Y2 = 22
Y3 = 0
Y4 = 22
Y5 = 0
Y6 = 22
Y7 = 0
Y8 = 22
Y9 = 0
Y10 = 22
'Y11 = 113
'Y12 = 0
Me.DrawWidth = 10

Color = RGB(0, 0, 0)

Me.Line (x1, Y1)-(x2, Y2), Color
Me.Line (X3, Y3)-(X4, Y4), Color
Me.Line (X5, Y5)-(X6, Y6), Color
Me.Line (X7, Y7)-(X8, Y8), Color
Me.Line (X9, Y9)-(X10, Y10), Color
'Me.Line (X11, Y11)-(X12, Y12), Color


'If Me.Number.IsVisible Then
' Me.line0.Visible = True
'Else
' Me.line0.Visible = False
' End If


I would place the line0 code in the Format event and refer
to the original txtNotes text box.

BTW, you could simplify the line drawing by using the Step
option and the fact that all the lines have the same top and
bottom:

Me.Line (X1, Y1) - Step(0, Y2), Color
Me.Line (X3, Y1) - Step(0, Y2), Color
Me.Line (X5, Y1) - Step(0, Y2), Color
. . .
which would remove the need for 26 of the statements in your
code.
 
The only problem there is that the format event is
currently holding the following code to "shade" one of
the "columns" that the Print Event creates:

Private Sub Detail_Format(Cancel As Integer, FormatCount
As Integer)
Dim X11 As Single, Y11 As Single
Dim X12 As Single, Y12 As Single


Dim Color1 As Long

' Specify unit of measurement for coordinates on a
page...
Me.ScaleMode = 5 ' Specify that measurement occur in
inches.

' Set line to print 5 inches from the left margin.
X11 = 8.235
X12 = 8.235

' Set line to print from the top of the detail section
' to a maximum height of 22 inches.
Y11 = 0
Y12 = 22
Me.DrawWidth = 453

Color1 = 12632256

' Draw the line with the Line method.
Me.Line (X11, Y11)-(X12, Y12), Color1
End Sub

Is there anyway to add the If statement to this and if so,
I have only drawn vertical lines, how do you draw
horizontal ones?

Thank you for your continuing help in this!

Paul
 
Please excuse my previous mesg. I must have had gone
temp. brain dead on the line. The visibility works
great. Only one detail for the visiblity. It currently
works as below
Project Code Notes Comments
_______________________________________________
1 jfklajflk F jfajflkj fjkaljfkafjlka
_______________________________________________
2 jfkaljflka F jfkajfl jkfljaljlaj
_______________________________________________
3 fjklafjlka F jklafjl fjkajfkljalf
_______________________________________________
kfajlkjalkjal
fafkjlkaj
fkajflka
4 jfklajflk F jfjfdja jkfajfajafjaj

The line is right above the Count field txt box. Is there
any way to designate to print only above the count field?


Thank you again, you will never know how good it feels to
be this close to being finished!

Paul
 
-----Original Message-----
Paul said:
Please excuse my previous mesg. I must have had gone
temp. brain dead on the line. The visibility works
great. Only one detail for the visiblity. It currently
works as below
Project Code Notes Comments
_______________________________________________
1 jfklajflk F jfajflkj fjkaljfkafjlka
_______________________________________________
2 jfkaljflka F jfkajfl jkfljaljlaj
_______________________________________________
3 fjklafjlka F jklafjl fjkajfkljalf
_______________________________________________
kfajlkjalkjal
fafkjlkaj
fkajflka
4 jfklajflk F jfjfdja jkfajfajafjaj

The line is right above the Count field txt box. Is there
any way to designate to print only above the count field?

Where do you have the Line control? I thought it was at the
top of the detail section and that the code should make it
visible as needed. I honestly don't see how it could
produce the above output.

Or are you drawing the line yourself? If so, please post
the code you're using.

Thank you again, you will never know how good it feels to
be this close to being finished!

You're welcome, but, after all these years, I definitely
know how good it feels to turn a difficult problem into a
workable solution ;-)

--
Marsh
MVP [MS Access]
.
Sorry for the late response. But here goes with the line.
I did not draw the line with code (I do not know how
to "code" horizontal code, worked with the code I posted
earlier, but could not manage to code horizontally). The
line was placed right above the count box, which is
located beside the txtNotes. I then when to On Format of
the detail and placed:
If Me!txtNotes.IsVisible Then
Me!Line49.Visible = True
Else
Me!Line49.Visible = False
End If

The above code was placed below the following code (which
is an extremly wide line that serves the purpose
of "shading" a column):
Private Sub Detail_Format(Cancel As Integer, FormatCount
As Integer)
Dim X11 As Single, Y11 As Single
Dim X12 As Single, Y12 As Single


Dim Color1 As Long

' Specify unit of measurement for coordinates on a
page...
Me.ScaleMode = 5 ' Specify that measurement occur in
inches.

' Set line to print 5 inches from the left margin.
X11 = 8.235
X12 = 8.235

' Set line to print from the top of the detail section
' to a maximum height of 22 inches.
Y11 = 0
Y12 = 22
Me.DrawWidth = 453

Color1 = 12632256

' Draw the line with the Line method.
Me.Line (X11, Y11)-(X12, Y12), Color1

If you have any ideas please pass them along. Once again,
and I most likely can not say this enough, Thank You, the
report and my general knowledge of Access and code has
grown and "I Really Enjoy It!"

Paul
 
I think it is DONE!!!!!!!!! "Think" being the optional
word.lol.... The lines are now correct (had to work with
the placement) and the grouping that I wanted/needed is
fixed! Once again thank you for your continuing help and
understanding! Now it is time to start using this
database and hope that it is "fool proof" enough.

Thank you once again and may you be blessed with a long
and filling life!!!!!

Paul
-----Original Message-----
-----Original Message-----
Paul said:
Please excuse my previous mesg. I must have had gone
temp. brain dead on the line. The visibility works
great. Only one detail for the visiblity. It currently
works as below
Project Code Notes Comments
_______________________________________________
1 jfklajflk F jfajflkj fjkaljfkafjlka
_______________________________________________
2 jfkaljflka F jfkajfl jkfljaljlaj
_______________________________________________
3 fjklafjlka F jklafjl fjkajfkljalf
_______________________________________________
kfajlkjalkjal
fafkjlkaj
fkajflka
4 jfklajflk F jfjfdja jkfajfajafjaj

The line is right above the Count field txt box. Is there
any way to designate to print only above the count
field?

Where do you have the Line control? I thought it was at the
top of the detail section and that the code should make it
visible as needed. I honestly don't see how it could
produce the above output.

Or are you drawing the line yourself? If so, please post
the code you're using.

Thank you again, you will never know how good it feels to
be this close to being finished!

You're welcome, but, after all these years, I definitely
know how good it feels to turn a difficult problem into a
workable solution ;-)

--
Marsh
MVP [MS Access]
.
Sorry for the late response. But here goes with the
line.
I did not draw the line with code (I do not know how
to "code" horizontal code, worked with the code I posted
earlier, but could not manage to code horizontally). The
line was placed right above the count box, which is
located beside the txtNotes. I then when to On Format of
the detail and placed:
If Me!txtNotes.IsVisible Then
Me!Line49.Visible = True
Else
Me!Line49.Visible = False
End If

The above code was placed below the following code (which
is an extremly wide line that serves the purpose
of "shading" a column):
Private Sub Detail_Format(Cancel As Integer, FormatCount
As Integer)
Dim X11 As Single, Y11 As Single
Dim X12 As Single, Y12 As Single


Dim Color1 As Long

' Specify unit of measurement for coordinates on a
page...
Me.ScaleMode = 5 ' Specify that measurement occur in
inches.

' Set line to print 5 inches from the left margin.
X11 = 8.235
X12 = 8.235

' Set line to print from the top of the detail section
' to a maximum height of 22 inches.
Y11 = 0
Y12 = 22
Me.DrawWidth = 453

Color1 = 12632256

' Draw the line with the Line method.
Me.Line (X11, Y11)-(X12, Y12), Color1

If you have any ideas please pass them along. Once again,
and I most likely can not say this enough, Thank You, the
report and my general knowledge of Access and code has
grown and "I Really Enjoy It!"

Paul
.
 
Paul said:
I think it is DONE!!!!!!!!! "Think" being the optional
word.lol.... The lines are now correct (had to work with
the placement) and the grouping that I wanted/needed is
fixed! Once again thank you for your continuing help and
understanding! Now it is time to start using this
database and hope that it is "fool proof" enough.

Thank you once again and may you be blessed with a long
and filling life!!!!!

Now, that is good news. And thank you for letting us know
this issue is resolved.
 
Back
Top