Snuggle Walrus
Member
- Local time
- Today, 17:12
- Joined
- May 14, 2020
- Messages
- 32
Hi all, i'm trying to understand record locking and how to use it correctly within my new form. The designs a bit....strange managing customer accounts with a sub form that allows the user to put an order through as well. It seems to work really really well however on my submit button Access warns me that the record is currently being edited and needs to be 'saved' 'discarded' or copy to clipboard. Hitting save has the desired effect, i assume whats happening is how i'm generating the fresh record when the form opens and then potentially moving customer info from the main form into the subform see below...
is what might be making it feel like the values have been changed....Anyway the overwrite with just clicking 'save changes' seems to do the trick just fine but i'd like it if possible to not show up at all and I 'think' record locking is the way to go but i'm not sure I understand it fully.... Anyone have any ideas as to how to avoid this popping up? or a way to perhaps tell VBA if it does pop up to just save the record as shown on the form if record locking isent the way? Thanks everyone have a fantastic day!
EDIT: Ok so i narrowed down the write conflict. I use a query in the early part of my button click to tick a box to say that the order has been 'requested' this way when i go through potential 'unwanted' created orders anything that wasnt manually submitted could be removed, if i comment out this line I dont get the write error.....
Code:
Forms![WORKING ON].frm_Subform_ManageNewOrders_RightSide!CustomerDetails_CB = VCurrentCustomerID
Forms![WORKING ON].frm_Subform_ManageNewOrders_RightSide!ShippingAddress_Order = VCurrentCustomerAddress
Forms![WORKING ON].frm_Subform_ManageNewOrders_RightSide!ShippingPostCode_Order = VCurrentCustomerPostCode
is what might be making it feel like the values have been changed....Anyway the overwrite with just clicking 'save changes' seems to do the trick just fine but i'd like it if possible to not show up at all and I 'think' record locking is the way to go but i'm not sure I understand it fully.... Anyone have any ideas as to how to avoid this popping up? or a way to perhaps tell VBA if it does pop up to just save the record as shown on the form if record locking isent the way? Thanks everyone have a fantastic day!
EDIT: Ok so i narrowed down the write conflict. I use a query in the early part of my button click to tick a box to say that the order has been 'requested' this way when i go through potential 'unwanted' created orders anything that wasnt manually submitted could be removed, if i comment out this line I dont get the write error.....
Last edited: