From: Highlight between 3 fields on 18 Mar 2010 03:43
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:
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
oppp = aaa
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
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:
Thanks a lot
From: Highlight between 3 fields on 21 Mar 2010 18:41
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 22 Mar 2010 02:55
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:
Can you please make it to sort by [Item] name?
Thanks a lot
From: John W. Vinson on 22 Mar 2010 11:55
On Sun, 21 Mar 2010 23:55:01 -0700, Highlight between 3 fields
>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:
>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
John W. Vinson [MVP]
From: Highlight between 3 fields on 22 Mar 2010 20:18
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:
Here is MS access sample 2007 sd same of picture:
Thank you very for your time.