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!

Combo box control cannot be edited; it's bound to autonumber field 1

Status
Not open for further replies.

hurrysundown

Technical User
Aug 29, 2005
2
0
0
US
This will likely be really simple for anyone with experience. But I have looked thru MS Access Help, Northwind database, this forum and three Access books and cannot find this answer.

I am designing a simple form using two tables. I want to include a combo box control based on an employee table that will allow me to display and change the person responsible for a task.

Following all the examples I have seen, I opened the form in edit view, used the controls wizard, selected the combo box and placed in on the form by dragging the EmployeeID (Primary Key and autonumber field). I told the wizard I wanted to look up the values in a table, selected the Employee table, selected two fields (EmployeeID and Name), hid the key column as recommended and was left with one column as I expected.

The Control Source is EmployeeID; the RowSource contains both EmployeeID and Name; The column count is 2; the bound column is 1.

Whenever I run the form and try to change the assigned employee, I get the message in the subject line -

"Control cannot be edited; it's bound to autonumber field "EmployeeID".

Can anyone provide a solution please? Thank you.
 
This one sounds like your form is bound to the employee table. As the EmployeeID is your primary key, if the form is bound to this table, then selecting an employee is effectively trying to re-add this record to the employee table.

A couple of things to look for:

- that your recordsource for the form is your second table, not your employee table. Your rowsource for the combo can still look up the employee table while being bound to the second table; and

- that your second table's design has the foreign key "EmployeeID" set to number, not autonumber. As it's a foreign key, it does not need to be unique in your second table.

Hope this helps,

Grant
 
How are ya hurrysundown . . . . .
The combobox needs to be unbound. [blue]Remove the Control Source.[/blue]

Calvin.gif
See Ya! . . . . . .
 
How are ya hurrysundown . . . . .

The combobox needs to be unbound. [blue]Remove the Control Source.[/blue]

Calvin.gif
See Ya! . . . . . .
 
Set the Control Source to the "person responsible for a task".

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top