Record navigator index?

N

Nicolae Fieraru

Hi All,

I have a table with an index (autonumber) and an instrument number (number).
I created a form based on the table and I can browse through the records
using the index. I wonder if it is possible to have displayed the
InstrumentNo in the navigator, instead of the index.

The field called InstrumentNo has no duplicate records and I need to let the
user to delete/reinsert the same Instrument number record as desired, this
is the reason I can't use this field as an autonumber. The value of Index
field has no meaning for the user and I want them to be able to go to the
InstrumentNo of their choice.


Regards,
Nicolae
 
A

Arvin Meyer

You can create an index on the InstrumentNo field in the same way as the
autonumber. Just don't make it the Primary Key. The index merely speeds
finding records. You can have up to 32 indexes (including those in
relationships) on an Access table. Coding is simple also. Wherever the
Autonumber field is called, just replace it with the InstrumentNo. For
example:

Set rst = db.OpenRecordset("Select * From tblName where ID = " &
Me.txtSearch)

can be changed to:

Set rst = db.OpenRecordset("Select * From tblName where InstrumentNo = " &
Me.txtSearch)

As long as InstrumentNo is unique, you'll find a single record.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
A

Arvin Meyer

To add to my post, the record navigator does not display the key number,
except coincidentally. It displays the count and position of the record in
that recordset (usually the form's recordsetclone) So, if you based your
form on a query that selected a subset of records, the numbers would be
different from the Primary Key index that you now have. Using the
recordset.findfirst method you can type in a number and retrieve that
record.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
A

adsl

Nicolae Fieraru said:
Hi All,

I have a table with an index (autonumber) and an instrument number
(number). I created a form based on the table and I can browse through the
records using the index. I wonder if it is possible to have displayed the
InstrumentNo in the navigator, instead of the index.

The field called InstrumentNo has no duplicate records and I need to let
the user to delete/reinsert the same Instrument number record as desired,
this is the reason I can't use this field as an autonumber. The value of
Index field has no meaning for the user and I want them to be able to go
to the InstrumentNo of their choice.


Regards,
Nicolae
 
A

adsl

Arvin Meyer said:
You can create an index on the InstrumentNo field in the same way as the
autonumber. Just don't make it the Primary Key. The index merely speeds
finding records. You can have up to 32 indexes (including those in
relationships) on an Access table. Coding is simple also. Wherever the
Autonumber field is called, just replace it with the InstrumentNo. For
example:

Set rst = db.OpenRecordset("Select * From tblName where ID = " &
Me.txtSearch)

can be changed to:

Set rst = db.OpenRecordset("Select * From tblName where InstrumentNo = " &
Me.txtSearch)

As long as InstrumentNo is unique, you'll find a single record.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
A

adsl

Arvin Meyer said:
To add to my post, the record navigator does not display the key number,
except coincidentally. It displays the count and position of the record in
that recordset (usually the form's recordsetclone) So, if you based your
form on a query that selected a subset of records, the numbers would be
different from the Primary Key index that you now have. Using the
recordset.findfirst method you can type in a number and retrieve that
record.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top