From: Highlight between 3 fields on
Thank you for your comment

I have Form with list post and filter for searching by textbox.
The scour for this form is query.
I want make count number to know how many raw are on this post list and show
with every post a number (witout number, I can't know how many raw of post
on the list)
I create a textbox and insert on it this code:

=oppp(IIF(true;1;0))

And create a modul that looks as this:

Option Compare Database
Dim aaa As Integer

Function oppp(sss) As Integer

If sss = 1 Then
aaa = aaa + 1
ElseIf sss = 0 Then
aaa = 0
End If
oppp = aaa

End Function


The problem is number work good then it starts just step increase when I
move the list up & down. Even if I close the form and restart it or update
the form, just larger number.

Is there better idea to get the counter on form on MS Access 2007 ?
So every time I make search by filter, so it show the count number like

1
2
3
4

so on with every search it will looks like it. The number have nothing with
post, just to show how many raw on the list.

Here is example of what I mean that have above code:
http://home.swipnet.se/georgedesign/db6.mdb


Thanks a lot
From: Highlight between 3 fields on
Hello Mr John W.

I found your replay to other people that have near to my question.
I test that you wrote and it work.

Thank you very much.
From: Highlight between 3 fields on
Hi Mr John W.

Your code make a sort by [ID] then it work ok, but I have the sort by [Item]

=DCount("*", "queryname", "[ID] <= " & [ID])

So now it looks the number as:
5
100
14
21
25
50
So on.

Can you please make it to sort by [Item] name?

Thanks a lot
From: John W. Vinson on
On Sun, 21 Mar 2010 23:55:01 -0700, Highlight between 3 fields
<Highlightbetween3fields(a)discussions.microsoft.com> wrote:

>Hi Mr John W.
>
>Your code make a sort by [ID] then it work ok, but I have the sort by [Item]
>
>=DCount("*", "queryname", "[ID] <= " & [ID])
>
>So now it looks the number as:
>5
>100
>14
>21
>25
>50
>So on.
>
>Can you please make it to sort by [Item] name?
>
>Thanks a lot

I'm sorry, but I have no idea what you're talking about. You didn't ask for a
sort, and I didn't suggest anything to sort.

Please post some more context. The DCount() function counts records. It
doesn't do any sorting and it's not intended to do any sorting! What's the
context?

--

John W. Vinson [MVP]
From: Highlight between 3 fields on
Hello Mr Johan

Thank you for your replay.
I send you a sample to show you that the number is not correct growing, so
how can I make it correct.
And I still have sort by Item as(a, b, c, d .....
And DIDIDI have not sort and contain code Dcount()

Here is a picture to see:
http://home.swipnet.se/georgedesign/count123456.jpg

Here is MS access sample 2007 sd same of picture:
http://home.swipnet.se/georgedesign/autocount.accdb

Thank you very for your time.