If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Check/Uncheck All, write conflict
Hello,
I have a form +subform, on the subform (countinuous form) I have a check box. on the main form I have an unbound check box that I want to check/uncheck all the check boxes of my records on my subform. I have an update query to perform that task. -Problem 1: after ticking/unticking the check box on the main form, I get all the check boxes on my subform ticked except the first record where the focus is. -Problem 2: I get a write conflict message " Save records or Copy to clipboard or Drop change " Can someone assist ? Many thanks. |
#2
|
|||
|
|||
Check/Uncheck All, write conflict
"2vao" wrote in message
... Hello, I have a form +subform, on the subform (countinuous form) I have a check box. on the main form I have an unbound check box that I want to check/uncheck all the check boxes of my records on my subform. I have an update query to perform that task. You have to bind that text box or check box to something. So, two choices: Add a check box column to the table, and then bind that checkbox to that column. Or, you can use my multi-select example he http://www.members.shaw.ca/AlbertKal.../msaccess.html The above example shows you how to select multiple items from a continues form, and then use those selections for whatever. The nice feature of this example is that it does not use a actual field in the database to accomplish this. -Problem 2: I get a write conflict message " Save records or Copy to clipboard or Drop change " If you run some update on a records that are "dirty", then you get that conflict (the other user changing things is in fact your code). Just ensure you force a disk write before you run any update(s) on potentially the same record that may already be dirty. the code to force a disk write is: if me.dirty = true then me.Dirty = false ......your update code goes here...... So, just make sure you force a disk write of the record as above...... -- Albert D. Kallal (Access MVP) Edmonton, Alberta Canada |
#3
|
|||
|
|||
Check/Uncheck All, write conflict
Thank you Albert, the link you gave has many helpful tips and samples, thank
you for sharing. I actually saved most of the exemples. I managed to find out the cause of my problem but it led me to another obstacle. The reason why I got problem 1 and the write conflict message was because I have one field ( field2) in my table that copies the value of another field (field1) of the same table ( the reason why I created that 2nd field is because I want to record the initial value of field1 before its value changes ). my code was Private Sub Form_Current() Me.field2.value = Me.field1 End sub After removing the above code, my check box works perfectly- however I could not copy the value of field1 one anymore. Would you know a solution to this ? I still want to copy the value of filed1 and be able to use the check/uncheck all feature. Many thanks. "Albert D. Kallal" wrote: "2vao" wrote in message ... Hello, I have a form +subform, on the subform (countinuous form) I have a check box. on the main form I have an unbound check box that I want to check/uncheck all the check boxes of my records on my subform. I have an update query to perform that task. You have to bind that text box or check box to something. So, two choices: Add a check box column to the table, and then bind that checkbox to that column. Or, you can use my multi-select example he http://www.members.shaw.ca/AlbertKal.../msaccess.html The above example shows you how to select multiple items from a continues form, and then use those selections for whatever. The nice feature of this example is that it does not use a actual field in the database to accomplish this. -Problem 2: I get a write conflict message " Save records or Copy to clipboard or Drop change " If you run some update on a records that are "dirty", then you get that conflict (the other user changing things is in fact your code). Just ensure you force a disk write before you run any update(s) on potentially the same record that may already be dirty. the code to force a disk write is: if me.dirty = true then me.Dirty = false ......your update code goes here...... So, just make sure you force a disk write of the record as above...... -- Albert D. Kallal (Access MVP) Edmonton, Alberta Canada |
#4
|
|||
|
|||
Check/Uncheck All, write conflict
because I want to record the initial value of field1 before its value changes ). my code was Private Sub Form_Current() Me.field2.value = Me.field1 End sub I don't think we need the above in the on-current event. I mean just using the page up/down or browsing reocrds is going to cause that code to run... I would think we ONLY want that code to run when you actually are modifying the contensts of field1. So, in field1 AFTER UPDATE event which ONLY fires if you made changes, you would go: me.Field2.Value = me.field1.OldValue Using the on-current event fires all the time...even when you don't edit/modify anything in the record..... -- Albert D. Kallal (Access MVP) Edmonton, Alberta Canada |
#5
|
|||
|
|||
Check/Uncheck All, write conflict
Thank you very much Albert, it is working perfectly. Many thanks.
"Albert D. Kallal" wrote: because I want to record the initial value of field1 before its value changes ). my code was Private Sub Form_Current() Me.field2.value = Me.field1 End sub I don't think we need the above in the on-current event. I mean just using the page up/down or browsing reocrds is going to cause that code to run... I would think we ONLY want that code to run when you actually are modifying the contensts of field1. So, in field1 AFTER UPDATE event which ONLY fires if you made changes, you would go: me.Field2.Value = me.field1.OldValue Using the on-current event fires all the time...even when you don't edit/modify anything in the record..... -- Albert D. Kallal (Access MVP) Edmonton, Alberta Canada |
Thread Tools | |
Display Modes | |
|
|