'1 of x' records in a form

AndyCabbages

Registered User.
Local time
Today, 10:47
Joined
Feb 15, 2010
Messages
74
Hi there,

I am having great difficulty adding a simple '1 of x' display on one of my forms.

I am not talking about the automatic one that Access has in the very bottom of the form (for some reason this is hidden anyway). I am looking for one which will appear at the top of the form or anywhere I want it to on the form. One which is visible in the design view and can phisically be moved around.

Andy
 
Set the Control Source property of a text box to this:

Code:
=Me.CurrentRecord & " of " & Me.count
 
Thanks for the quick response.

I have done as you instructed and all that happens is that the box says '#Name?'
 
Oh yes, it would. Sorry, set your text box's value on the On Current event of your form:

TextBoxName = Me.CurrentRecord & " of " & Me.count
 
Sorry, I dont quite follow what you mean, I cant seem to find any value options called 'On Current Event'
 
When I do that I dont get the option of 'On Current Event'

I am using Access 2000, is it possible that the settings are different?
 
Right click your form (not your control), click Properties, on the properties sheet at the top click the EVENT tab. There's an event called ON CURRENT or CURRENT. I believe the events haven't changed much.
 
Ah, I see what you mean. I was able to do this on another form but for some reason when the form I want is opened it automatically clicks on another control box and wont let me unclick it. This means I cant get the form properties up, just the control box properties. Dont supose you know how to solve this problem aswell?
 
I don't understand what's going on there based on what you've explained. Zip, upload and post the db here and I'll have a look. (Click Go Advanced to see the Manage Attachments button)
 
I can't send you the complete database for security reasons. I am working on it for a company as a final year project and part of the agreement is that I do not share the information with anyone.

I am working on cutting the database down a bit to only include this form and the table related to it with no data in. Bare with me while I prepare something to upload
 
Sounds like your project doesn't include any form of coding?

You can get to the form's On Current even from the VBA editor window.
 
More coding than I would have liked. I am still trying to wrap my head around the Visual Basic side of it, but it's slow progress. The project is still in the early days though so I've got lots of time to do the learning

How do I get into it on the VBA editor and what sort of coding would need to be done?
 
Since your project is in its early stages it would be worthwhile you picking up a couple of Access/VBA books from your local library and/or uni library. Those books would explain about the VBA editor, properties of controls, concepts of Access etc... more than I could (via this forum).
 
This works in 2003 not sure about 2000

With you form in design view click CTRL + G
This will open up the VBA for you, then paste in the following.

Private Sub Form_Current()
TextBoxName = Me.CurrentRecord & " of " & Me.count
End Sub

Paste the code below any other code that might be there.
TextBoxName should be replaced with the name of the text box you are using.
 
I have tons of books on Acces and VBA. The only problem is sifting through all the useless stuff trying to find anyting useful. It desnt help that when looking in the glossary for something like '1 of x' theres absolutely nothing
 
I have tons of books on Acces and VBA. The only problem is sifting through all the useless stuff trying to find anyting useful. It desnt help that when looking in the glossary for something like '1 of x' theres absolutely nothing
You're looking for a solution without understanding the concept. If you tried dedicating some time to reading it from cover to cover you will find that the answer to your question is trivial. For you to make a "good" db for an organisation you must understand the concepts, to make an effective db, there has to be some form of vba coding involved. Those books are certainly not useless :)
 
Thanks ZigZag, that worked perfectly, for some reason it thinks there are 25 records when there only 17 though :s I will have to play around a bit.

And thank you vbaInet, you have been very helpful. I will give the books I have a good read. I am a little bit in over my head at the moment, it would do some good to have a thorough understanding if I'm going to get this database up and running.
 
Thanks ZigZag, that worked perfectly, for some reason it thinks there are 25 records when there only 17 though :s I will have to play around a bit.
Are you supposed to be counting based on your subform? Have you got a subform?
 

Users who are viewing this thread

Back
Top Bottom