Hi,
I'm developing an access solution and i've got a really, really annoying bug with one aspect of it.
This part of the application displays a list of Pending Orders in a multicolumn listbox, populated by a query. The user selects one of these orders and clicking 'Edit' to Add or Remove items to the order. This functionality works fine, until the order has been edited and the database tables updated. After this, if you subsequently try to click the ' Edit' button on that record the following error is thrown.
The line throwing this error is;
This recordset is created to simply hold the data that the order item information will be stored in, before adding it to the database (order items are generated in seperate stages, so this collates all the required info before inserting to the database)
I have already tried various checking on the State of the recordset, forcing it open or closed etc but this just throws different errors. I cant figure out why this bug occurs after the Order has been ammended - I'd have blamed some write permissions or table locking or something, but restarting has no effect. Once ammended, the record is totally shagged.
It is also worth noting that if I clone the record within the database, it will work perfectly.
View The Code
I appreciate its pretty hard to get a proper idea of what the problem is with this description so any questions, im happy to answer.
Thanks for any help you can offer,
Dave.
I'm developing an access solution and i've got a really, really annoying bug with one aspect of it.
This part of the application displays a list of Pending Orders in a multicolumn listbox, populated by a query. The user selects one of these orders and clicking 'Edit' to Add or Remove items to the order. This functionality works fine, until the order has been edited and the database tables updated. After this, if you subsequently try to click the ' Edit' button on that record the following error is thrown.
Code:
Runtime Error '3219'
Operation is not allowed in this context.
The line throwing this error is;
Code:
Dim tmpRec As New ADODB.Recordset
With tmpRec.Fields
.Append "ProductID", adVariant <----- error
.
.
.
This recordset is created to simply hold the data that the order item information will be stored in, before adding it to the database (order items are generated in seperate stages, so this collates all the required info before inserting to the database)
I have already tried various checking on the State of the recordset, forcing it open or closed etc but this just throws different errors. I cant figure out why this bug occurs after the Order has been ammended - I'd have blamed some write permissions or table locking or something, but restarting has no effect. Once ammended, the record is totally shagged.
It is also worth noting that if I clone the record within the database, it will work perfectly.
View The Code
I appreciate its pretty hard to get a proper idea of what the problem is with this description so any questions, im happy to answer.
Thanks for any help you can offer,
Dave.