using a text box to find a record number

jim84

Registered User.
Local time
Today, 21:22
Joined
Nov 4, 2002
Messages
23
I've got a text box and have it set it so that it shows the record number the form is currently on. This is the code:

=[Form].[CurrentRecord]

in the ControlSource.


I was wondering if it would be possible to allow the user to type in the record number they want in this text box? I dont mind if it gets rid of the first bit ^ !

Thanks,

Jim
 
Well, first up, by 'record number' do you mean the value in the primary key field of the table? If so, you need only bind the textbox's control source to that field and =[Form].[CurrentRecord] will be unnecessary. And, if the field is any datatype other than autonumber, you will be able to edit the value.

If it is an autonumber field, then you cannot edit the value manually. I think the only way to alter the value of the autonumber for an existing record would be to run an update query to change the value. However, I would strongly recommend against doing so since you could really mess up the seed of your autonumber field and possibly lead to not being able to add new records to your table (in which case you'd need to reset the autonumber seed). So, it's possible, but I would suggest it's inadvisable.

Perhaps you ought to read up on some topics like meaningless vs meaningful primary keys, referential integrity, and, probably, table normalization to help you better understand how you should be proceeding.
 

Users who are viewing this thread

Back
Top Bottom