AutoNumber Field In Forms

A

alamsyah

I have a table with one of the field as an autonumber type.
Create a form based on the table. There's another subform that was link
to the main form.

I want the form to populate based on a text field in the main form
which is an autonumber type.
When I try to change the value for that field. I've got a message
"Control can't be edited; it's bound to autonumber field 'borrowingID'
"

Anyone have a solution for this?
 
J

John Vinson

I have a table with one of the field as an autonumber type.
Create a form based on the table. There's another subform that was link
to the main form.

I want the form to populate based on a text field in the main form
which is an autonumber type.
When I try to change the value for that field. I've got a message
"Control can't be edited; it's bound to autonumber field 'borrowingID'
"

Anyone have a solution for this?

Well... don't use an Autonumber, then. Autonumbers cannot be edited,
period.

If you're linking to an autonumber field, you must use a Long Integer
field (instead of another Autonumber).

John W. Vinson[MVP]
 
A

alamsyah

Hm It doesn't really solved the problem. The autonumber field will be
the primary key.
A key that will fill the main form. Even if I change it to a Long
Integer Field I also don't
want the user to edit it. It's kind of search field. For example if I
put "2" then all the information for it will show in the form.
 
R

Rick Brandt

Hm It doesn't really solved the problem. The autonumber field will be
the primary key.
A key that will fill the main form. Even if I change it to a Long
Integer Field I also don't
want the user to edit it. It's kind of search field. For example if I
put "2" then all the information for it will show in the form.

You can use a control on a field to do searches or you can bind it to a field in
the underlying table. You cannot use a single control to do both.

If you want a control you can type in that will determine what is shown in the
subform then that control should have a blank ControlSource.

If you want an entry in that same control to influence what record is shown on
the main form as well then you need to use some VBA code to make that happen.

Please clarify what is on your forms and what behavior you want.
 

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