Hi All,
This is my first time posting but I am having a little trouble with some code that I thought was pretty simple.
I have a continuous form, that I am trying to update using a query. The form is for frmNavigation!frmSubform!frmContinuous.
On the continuous form, there is a tick box to mark that the record has been submitted and a field for the submission date.
I have a VBA sub linked to a button on the Subform "Submit". The VBA does it's stuff and I then need the date boxes populated with Now() which is dealt with through an update query (DoCmd.OpenQuery).
Because the user would tick the tickbox then immediately press the "Submit" button, the last selected record is still open and so cannot be changed so I get a record locked error.
I have tried
me.dirty = false
Me!frmContinuous.Form.Dirty = False
me.dirty = false on a OnClick for the tickbox control
DoCmd.Save
I've even tried closing the Subform record and moving to a new record on the Subform but still get the lock violation.
At the moment my workaround is to pop up a message box with a warning to move to a record without a tickbox before hitting the Submit button to unlock the record but that can't work if the continuous form has only one record.
Thanks for any help you could give me, it would be much appreciated.
This is my first time posting but I am having a little trouble with some code that I thought was pretty simple.
I have a continuous form, that I am trying to update using a query. The form is for frmNavigation!frmSubform!frmContinuous.
On the continuous form, there is a tick box to mark that the record has been submitted and a field for the submission date.
I have a VBA sub linked to a button on the Subform "Submit". The VBA does it's stuff and I then need the date boxes populated with Now() which is dealt with through an update query (DoCmd.OpenQuery).
Because the user would tick the tickbox then immediately press the "Submit" button, the last selected record is still open and so cannot be changed so I get a record locked error.
I have tried
me.dirty = false
Me!frmContinuous.Form.Dirty = False
me.dirty = false on a OnClick for the tickbox control
DoCmd.Save
I've even tried closing the Subform record and moving to a new record on the Subform but still get the lock violation.
At the moment my workaround is to pop up a message box with a warning to move to a record without a tickbox before hitting the Submit button to unlock the record but that can't work if the continuous form has only one record.
Thanks for any help you could give me, it would be much appreciated.