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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nav Btns and Records on the Form

Status
Not open for further replies.

Wizzweb

Technical User
Apr 12, 2003
20
0
0
GB
Hi

For cosmetic reasons, I want to place the Navigation buttons and recod numbers ON the form, rather than below. The Nav buttons are no problem, but it's the two text boxes with the records displayed that I can't remember how to do ... been over two years since I last did it and all I did then was alter the Properties.

Anyone out there remember how to do it.

Ken
 
Make a textbox. Set its control source to

[tt]=DCount("*","YourForm'sSourceTableOrQuery")[/tt]

That's your total records.

For the current record number you'll need to make an expression that takes into account the record order of your underlying data source. If the record order is order entered and you have an autonumber primary key, then you can do

[tt]=DCount("*","YourForm'sSourceTableOrQuery","YourPrimaryKeyField<="&[YourPrimaryKeyField])[/tt]

But if you have another order, then you must accomodate it with a change in the criteria in DCount. If you sorted by some imaginary fields called CompanyID and then by DateEntered (assuming no two entries can have the exact same CompanyID and DateEntered, down to the millisecond) then you'd do

[tt]=DCount("*","YourForm'sSourceTableOrQuery","CompanyID<" &[CompanyID] & OR (CompanyID=" & [CompanyID] &" AND DateEntered <=" & [DateEntered])[/tt]

Fun, isn't it? :)

But maybe someone else knows how to do this with simple property/setting changes instead of simulating the function of the record navigation toolbar.

-E²
 
I just realized you should have posted this in a specific database program's forum... I was working in Access just now and so I assumed Access and thus you got an answer for Access.

If that's not what you wanted, you'll need to tell us.
 
Hi

That is just what I wanted and all is working OK ... Thanks.

BTW ... I am working in A2K, so I assumed I was in the right forum

K
 
There are a number of specialised Access forums which you can find in the Related Forums panel in the right margin. This forum is mainly for general database discussion, rather than a specific type of database.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top