Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing all tick boxes following report 1

Status
Not open for further replies.

tontenn

Vendor
Dec 29, 2006
54
AU
Well I have asked two questions in the last week on this forum and have had two very successful responses. Lets hope its third time lucky as well.

I have a database with contact details and one of the reports i have created are mailing labels and they are decided by tick boxes in a field called "Labels". When the staff wish to do a mailout they search and select the clients and tick the label field in a form.

All that is good and the report with the labels works as well. But what we are having trouble with is clearing the tick boxes after we have printed the report. Other than letting the staff go in and filter the main table and delete them all is there an easier way that is simple and I could even design that would clear the tick boxes once the report has been produced automatically.

I thank you in advance.

Regards

Tones
 
What about an update query (SQL code):
UPDATE yourTable
SET Labels=False
WHERE Labels=True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PH

Im sure it will help, but not completely OFAY with how to do an update query. If you could give me some basic steps to follow that would be much appreciated. I have had a try of a few things and they just seem to be coming up wrong.

Thanks very much in advance.

Tones
 
You may do something like this in the Open event procedure of your form:
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE yourTable SET Labels=False WHERE Labels=True"
DoCmd.SetWarnings True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks PH
Once again you have made my day.
Unfortunately there was one thing I forgot to tell you. I dont just use one form but two forms that are ticked and then these labels are added to the report.

When I tried to put the same code on both forms it jacked up and wanted to debug one of them and then gave me an error.

Is there a way to do this for both of my forms or should I just cut my losses and make one of them the only one for labels.

Cheers in advance and thanks again for your help.

Tones
 
Put this code only once in which event procedure you want to clear the tick boxes.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top