Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

counter on form 1

Status
Not open for further replies.

hnunez4399

Programmer
Apr 10, 2003
62
US
How can I add a counter on a form so as a new record is added, the display counter continues to updated?
 
The standard record navigation tool already has a record counter ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
If you don't like the built in navigation tool with record indicator, you can make your own navigation buttons then put an unbound text box next to them using the following as the Control Source:

=IIf([CurrentRecord]>Count(*),"New Record",("Record " & [CurrentRecord] & " of " & Count(*)))

This will indicate the record number for an existing record or it will display "New Record" for a new one.

 
Or

Code:
Private Sub Form_Current()
 If Not Me.NewRecord Then
   Label.Caption = "Record " & CurrentRecord & " Of " & RecordsetClone.RecordCount & " Records"
 Else
   Label.Caption = "Record " & CurrentRecord & " Of " & (RecordsetClone.RecordCount + 1) & " Records"
	End If
End Sub

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
How are ya hnunez4399 . . .

I find myself in agreement with [blue]PHV[/blue] for the following reason:

Get the database done [blue]and then go back and add your frills![/blue]

Calvin.gif
See Ya! . . . . . .
 
Aceman1,

You know I'm a big fan of yours! But how do you know, from this posting, that hnunez4399 hasn't finished his database and is adding the final frills?

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Howdy missinglinq . . .

I don't! . . . Actually wether its complete or not is irrelavant, but I'd already hit submit and couldn't retract! [reading]

Calvin.gif
See Ya! . . . . . .
 
Uh huh! We've all wished our mind was quicker than our pointer finger!

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
thanks to all. I just added a text box with the code of
=count(*) and it accomplished what I needed. I am still new to VBA in access. So much of the code is new to me...

I do however need help on another issue.
The form is set up to open each time and filter for a new record with no data...

Although there might be records already in the table. My current counter already shows the new records I add but I also want a counter that shows the total records in the underlying table... How can I accomplish this?

Essentially, the form is based on a query which updates a table as it goes.

Let me know if more information is needed.
 
Have you tried to play with the DCount function ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top