1

I have a sale form with a subform , however i cannot choose data from my combo box.I get the following

Control cannot be edited , it is bound to autonumber field Item_ID

Below is the SQL

SELECT [tblStockItem].[Stock_ID], [tblStockItem].[Item_ID] FROM tblStockItem ORDER BY [Item_ID];
HansUp
  • 95,961
  • 11
  • 77
  • 135
user2650277
  • 6,289
  • 17
  • 63
  • 132

1 Answers1

2

It sounds like the purpose of the combo box is to select data, not change stored values. In that case, make it an unbound control --- meaning leave its Control Source property empty.

Then you can do your data selection based on the combo's value without Access complaining about changes to that autonumber field.

HansUp
  • 95,961
  • 11
  • 77
  • 135
  • it solve the issue.However the Item_ID is what links the subform and main form.When i select an `Item_ID`in combo from main form , the details corresponding to that Item_ID in subform do not change – user2650277 Jul 12 '15 at 13:15
  • Use the combo box in the subform control's *Link Master Fields* property, and leave *Item_ID* in the *Link Child Fields* property. – HansUp Jul 12 '15 at 13:19
  • There is no combo in the subform , i created one in the main form to change fields in subform(i.e depend on item id).Item id exist both in main form and subform.`Item_ID` is hidden in subform – user2650277 Jul 12 '15 at 13:22
  • Link the main form's combo to the subform's *Item_ID* field. It doesn't matter whether or not the subform *Item_ID* is hidden. – HansUp Jul 12 '15 at 13:24
  • can you show me how to do that , i have been trying to do this for hours now. – user2650277 Jul 12 '15 at 13:29
  • Open the subform control's property sheet. Find the *Link Master Fields* property on the Data tab of that property sheet. Type in the name of your combo box as the value of that property. What happens now? – HansUp Jul 12 '15 at 13:39
  • 1
    Thanks a ton ...i was struggling with this for hours, wish i could give more upvotes – user2650277 Jul 12 '15 at 13:46
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/83069/discussion-between-user2650277-and-hansup). – user2650277 Jul 12 '15 at 14:27