Find Current Record Number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table that does not (and can not) have a primary key. I want to
open a new form to display a record that I have already selected. If you are
in table view you can type in the number of the record that you want to go to
but the user won't know what that number is from the form view. Is there a
way to find out the number of the record that I am currently in?

Thanks in advance,

Suzie
 
No, Access does not support record numbers. I would be curious as to why a
table cannot have a primary key, but that would not get you where you want to
go. If you have no unique way of identifying a record, then you may consider
andding an Autonumber field to the table and use that.
 
A form does have the CurrentRecord property, which displays the ordinal
number (long integer) for the record's order in the form's current
recordset. But it's completely dependent upon the order specified (or not
specified) in the form's RecordSource, so it's not a unique identifying key
from one form to another.

If a record does not have a primary key, then use all the fields in the
record as the 'key' and do a "find" based on the value of all the fields. If
two records can have the exact same values for all fields, then this too
won't work to uniquely identify a record.
 
Ken,
Are you stalking me today ? :)

Dependin on the record size, that could be slow and cumbersom. I still
don't understand why a table can't have a primary key. I guess it is because
there is no one field or combination of fields that will have unique values?
When I see problems like this, the first thing I think is DATABASE DESIGN
ALERT!
pardon the shouting, but bad database design creates a multitude of problems.
 
In a philosophical sense, you are correct; however, technically it is not
required. I will use a temporary table with no key to import Excel data and
clean it before I update my data tables, for example.
 
No disagreement with you about adding an autonumber primary key field to a
table....your point on that is well-stated for the OP. But sometimes, ya
gotta work with what ya got... < g >

--

Ken Snell
<MS ACCESS MVP>
 
Back
Top