ngreenleaf
Programmer
I want to lock all records in a table only for a small point in time during a particular event procedure. The user enters text in a text box, and I want to insert it in the table and requery the table instantly in order to find out what autonumber was assigned to that new record. If I have multi-users there can be issues unless I lock the table before the insert and unlock it after the autonumber is identified.
It appears that I cannot set the recordsource and recordlock properties in the middle of the form's execution. The error message says that the table is being "used exclusively by someone else or is being used by the interface and cannot be programmatically manipulated". As I am currently the only user - the second situation seems to be more likely.
I prefer not to have the locks set for the entire time a user is in the form. Is there a way to do this? As an FYI - I don't have the form recordsource set to anything -- the form uses many tables and queries -- so I code them as necessary in VB. But I can set the recordsource to the desired table and that works fine as well... it is changing the locks that causes the problem.
It appears that I cannot set the recordsource and recordlock properties in the middle of the form's execution. The error message says that the table is being "used exclusively by someone else or is being used by the interface and cannot be programmatically manipulated". As I am currently the only user - the second situation seems to be more likely.
I prefer not to have the locks set for the entire time a user is in the form. Is there a way to do this? As an FYI - I don't have the form recordsource set to anything -- the form uses many tables and queries -- so I code them as necessary in VB. But I can set the recordsource to the desired table and that works fine as well... it is changing the locks that causes the problem.