form with listbox showing records and records can't be edited in vb without error

Joined
Apr 12, 2007
Messages
2
Reaction score
0
Hi,
Hope you can help me understand some concept that I'm missing.

I have a form that has a listbox called lboShowrecs - it shows the results of a query. I can click on the records in the query and the rest of the form updates to show fields of the record I picked. I have a buton on the form to modify the record chosen. The code is long and drawn out - so I'll try to avoid posting (unless you really want the 10 pages)- I just think I'm missing something basic.

When the button is clicked -it grabs a field value from the form (keyfield for the tables)- then opens a recordset, finds the record, edits the record and does an update and close. Then it opens another recordset from another (related) table and edits the related record. Then the code does a requery on the lboShowRecs because the changes to the selected record should make it NOT appear in this list anymore.
When it's done I get the error 7787 saying that another user modified the record since I had it open.
Shouldnt I be able to edit a record like this without the error? I tried running a sql update on the record too - I got the same error.

Any tips are appreciated.

I'll suck up plenty later :-) right now Im just worn out!

Thanks,
Randy
 
OK - for anyone that thought about this - thanks. Just thought I'd put it out here if anyone comes across this in the future. What i figured out was that the form (with the list box showing the query) had a lock on the record that I selected in the listbox. So I got around the problem of not being able to edit the record by getting a handle to the fields of the record THROUGH the form itself - by putting the fields on the form and hiding the ones that I did not need.

Happy Day!

:-)
 
Back
Top