Hi All -
I have a application in which I am transferring data from MS Word tables to MS Access, using cut-and-paste. The nature of the data is such that while there are 17 fields in the MS Access records, only one of them - a Memo text field - is copied form the Word tables.
To do this, I have a main form with a sub-form using datasheet view. Controls on the main form are used to add records to the sub-form's underlying table, and to determine which records are currently displayed by resetting the subform's recordsource according to selections made in two combo boxes on the main form
So, say I want to add 15 new records to match certain criteria, with one field coming from the Word table. I set the criteria on the main form (the sub form now shows no records), set a counter to "15", and click a button to add 15 records, one at a time in a loop, using VBA. 15 records are shown, with all fields are filled in, except the one which which is coming from the MS Word table. This data I copy to MS Access using cut-and-paste from the table column in Word to the datasheet column in Access.
All this works fine, but after two or three iterations of setting criteria, adding records, and pasting data, Access will give me error 2074 - "This operation is not supported within transactions"
The error is raised when I try to reset the subform's recordsource with new criteria:
sfrmStatement.Form.RecordSource = " SELECT * FROM Edit_Job_Statement_Query WHERE Statement_Category = " & cboFilterStatement & _
" and [Duty_id] = " & SelectDuty
cboFilterStatement and SelectDuty are the two combo boxes.
I have no idea what the problem here is, but there is a clue: I do trap the error, and if I close the main form and reopen it, I notice that the paste operation PRIOR to the error did not work, even though on the screen it looks as if it did.
It's as if there is an update that is still "pending" somewhere. I have put dirty = false in as many places as I could think of, but no luck.
Does anyone have any ideas as to what is happening?
Thanks
John