Please Help me with Check Box issues

the kind of check boxes i use are being generated upon addition of new data, so i cant probably put every check box for every single record
 
That's why then, you need to tell Access to do everything you want it to do, it doesn't know already :)

So when you say on addition of new data, are the checkboxes you want in a form that's in continuous view by any chance? If that's the case, technically they're just the same check box repeated over and over so you won't be able to use the method above. If you want to check all the boxes in a particular list of records you need to use an update query - you can use these in VBA.
 
please give a hint on the update query to use,
 
OK, this might get slightly complicated. Now, I'm guessing that your subform is showing the records you want to update yeah? What you need to do is create an update query to say "Update the check box where the records match the link criteria in the subform." So what you need to do is create your query in design view, using the table behind the subform. Drag down the check box field, and the fields in the table that the subform uses as a link. Put an x in the criteria of the link fields (I'll expliain why in a minute). In the "update to" bit of the check box field, put "true".

Now switch to SQL view. Copy the text. Go to your VBA editor, in the on click event of your master check box put "docmd.runsql" and paste your SQL code in. Now, look at the code, and where it says "WHERE [Link Field Name]="x"", take the x out and put your ink field name in.

Now, when you click on the master check box, it should update all the sub check boxes to true, and it should only do the ones that are displayed in the subform.
 
the kind of check boxes i use are being generated upon addition of new data

I'm sure there are plenty of people who can explain this better than me, but that's not quite how it works. Try and remember that if you've got a form in continuous view, it doesn't create new objects as you add records. Basically what you see is one record's worth of text boxes, check boxes etc. repeated over and over again so you can't just refer to one of them by name - they all have the same name. If you want to update a particular text box, you need to tell Access which one with a query, as explained above.

Good luck!
 
wow this is giving me serious headache, need some form of relief fast
 
Try the help file, or beer

(If you want a serious response, again, be descriptive :))
 
the issue is after i did that the check box'll tell me that it want to update 0 row when i check it, which should not be and for the beer i think that's cool for a hot day
 
I think you must have put the wrong criteria in then. Have a look back through it - I may not have been 100% on the link criteria as I haven't seen the DB.

Good luck! It's a teeny bit sunny here so I'm off for a liquid lunch
 

Users who are viewing this thread

Back
Top Bottom