Unable to edit records using ComboBox

back2basic

Registered User.
Local time
Today, 04:59
Joined
Feb 19, 2013
Messages
113
I have done this on another form and it is working great. I don't understand what the difference is and why it does not work?

I have setup a ComboBox on a form, Listed the PK of the table as the control source. Inserted the PK and many other field as the row source. When I go to select a record I get the error "control can not be edited, it's bound to a auto number field, "Asset_ID"

I have done this same thing (obviously not exact) on another table and field call Materials and do not have this problem.

Will anyone please provide advise?

Thank you
 
You can't edit an autonumber field - is this what your PK is?

If so, remove the controlsource of the combo so it is unbound and in the after updateevent of the combo put the following (change names to suit)

Code:
me.filter="[PK] = " & comboboxname
me.filteron=true
 
You can't edit an autonumber field - is this what your PK is?

If so, remove the controlsource of the combo so it is unbound and in the after updateevent of the combo put the following (change names to suit)

Code:
me.filter="[PK] = " & comboboxname
me.filteron=true
OK, Great Thank you. This helps. I can view and retrieve the record. But when I try to edit and insert the date in this record, the new date is always placed in the first record of the table. Why can I not edit the date of the record selected?
 
Would need to know more to answer - can you post the source to your form and any code around your date and form before and after update events.

Also, just as a check, Date is a reserved word, I don't think it will be an issue in this case but if you have used Date as field name in your table or as a control name, it can cause problems so just to eliminate a pssible problem, I would change to say FDate
 
Thank you, just thought I would let you know, the field name is "date_returned". so should not be a problem. In any event, I have come to realize, I am using a calculated value in my parent table "Materials" to calculate the amount of a material remaining.

This is a mistake and should be done by querying the records of the materials issued in the child table "Assigned_Materials"

What I was trying to do was recall a specific record in the child table so I could update the remaining material field and the date the material was returned.

I understand I can not do this since the record is bound to a parent table and locked by ref integrity?

Do you agree?
 
I don't actually use calculated fields but would imagine that you cannot update them directly. Might be an idea to post this as a new thread
 
I don't actually use calculated fields but would imagine that you cannot update them directly. Might be an idea to post this as a new thread

I think so too. I am one of those "old time" basic programmers who created a few DB's using Basic in the 90's. I thought I would help out the boss here and create a DB to track our equipment and who it is issued to. These applications (Access 2007, 2010) have come a long way and so has the principle of designing DB's. This forum has been a God send but now I am a prime example of one who has stepped out on the wrong foot based on what I have done in the past and now has to go back and restructure.

I think starting a new thread and posting in the queries forum will be helpful to other people.
 

Users who are viewing this thread

Back
Top Bottom