Sorry, I knew I should clarify that. It did compile, no errors. I am
running Access 2007 if that makes a difference. I even rebuilt the report a
couple of times just in case.
I have a text box "txtCount" it is counting up for each user. It just seems
like the "Cancel" Command does not do anything.
Option Compare Database
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Cancel = Me.TxtCount > 5
End Sub
Duane Hookom said:
What do you mean by "it does not work"? Didn't it compile? If it didn't you
should get an error message that you should share with us.
--
Duane Hookom
Microsoft Access MVP
:
It does show the increment per user. I had not complied the code. Is it as
simple as clicking "Debug" and complie? I tried that and it does not work.
Todd
:
If you set the txtCount text box to visible: Yes, does it increment?
Have you compiled your code?
--
Duane Hookom
Microsoft Access MVP
:
Hi,
I must be dumb. I have tried this several times and cannot get it to work.
I have created the txt box no problem. I cannot get the results to limit to
5. I have pasted the "Cancel = Me.txtCount>5" into the "On Format" property
field. I have created a code.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Cancel = Me.TxtCount > 5
End Sub
Ive tried () [] and I cannot get this to work. Please help.
Todd
:
You can add a text box to the detail section of the report:
Name: txtCount
Control Source: =1
Running Sum: Over Group
Visible: No
Then add some code to the On Format event of the detail section:
Cancel = Me.txtCount>5
--
Duane Hookom
Microsoft Access MVP
:
I have a query set up to show the total count of each item for each person on
my list. In my report i'd like to only show the first 5 count results for
each person listed. Currently it's set up to group by person, then show the
detail (count of item, item description) Do you have any suggestions?
The top 5 query didn't work because it only showed me the top 5 results of
the entire query, not for each person.
Thank you,