Results 1 to 10 of 10
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Canada
    Posts
    284
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CLEARING A CHECKBOX AFTER A REPORT (Access 2000)

    I've setup a form that lists all my students by name and I select each student from a combo box, and click on the Print Checkbox for that student to be able to print out labels. But when I close the print preview screen after I print the labels, I want to be able to clear all the "Print" checkboxes that have been checked so that I can start new each time I go into my Select Labels To Print form. Does anyone know how I would go about this? I tried a macro using SetValue, but I must be doing something wrong because it gave me an error message (you tried to run a Visual Basic procedure that improperly references a property or method of an object). I don't know what this message means. Can anyone help???

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: CLEARING A CHECKBOX AFTER A REPORT (Access 2000)

    I don't understand - do you select which student to print labels for by selecting the student from a combo box, or by ticking a check box, or both. From your description, I would guess the latter, but if so, why do you have to make two selections?
    Is the check box bound to a field in a table? (Look at the Control Source property of the check box)

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Canada
    Posts
    284
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CLEARING A CHECKBOX AFTER A REPORT (Access 2000)

    Well, the girl that's using my database said that she wanted to print labels. But she just wants to be able to select which students to print labels for. There is no rhyme or reason for the ones she selects, so you can't query, for example, students that are in grade 10 (just an example). So I did up a form (SelectLabelsfrm) that has a combo box where you select a student, then on the form it will show more detailed info of the student you selected (Last Name, First Name, Student ID #, Grade, and Home Room). Then you click on the Print Checkbox on that student to select it for printing. I added a Print field to the Student table. Then the Labels Report gets its labels to print out from a Labels Query which I created that queried the students that had a checkmark in the Print field. Should I have done it this way? Do you have a simpler solution? I then want it to clear the checkmark so that the next time you go into the SelectLabelsfrm form, you don't have to go and uncheck the ones that were checked off before. Any ideas?

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: CLEARING A CHECKBOX AFTER A REPORT (Access 2000)

    You can clear the checkboxes by creating an update query.

    Create a new query, add the students table , then add the field Print field to the query grid, then go to query in the menus and change the query type to update.
    this will add an update to line to the query grid. In the Print field put false on the update to line.

    Save this query as something like : "qryClearPrint", then in the code that prints the labels add another line at the end:

    <pre>docomd.openquery "qryClearPrint"</pre>


    This way the print checkboxes will be automatically cleared whenever you do a label run.
    Regards
    John



  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Canada
    Posts
    284
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CLEARING A CHECKBOX AFTER A REPORT (Access 2000)

    Okay, I think it will work, but something is happening with my first query. The one that queries for the Labels Report. It queries the Parents Names, Address, City, Prov, Postal Code, and Print fields. But when I open the form and select which ones to print, then click on the "Print Labels" button, the Print Preview shows the students less one student. I have to close the Print Preview, click on each student on the Select Labels form again from the combo box, and click on the "Print Labels" button again, before the correct number of students I selected shows up on the labels.

    For example, I have 3 students listed. I selected all 3 to print, I click on the "Print Labels" button, and the Print Preview comes up with only 2 showing. Then I close the Print Preview, and I have to click on each of the 3 students again. I don't have to click on the Print checkbox again because it is already checked. Then when I click the "Print Labels" button again, I see all 3 in the Print Preview.

    Please make note that I have not added in your Clear Print Query because I wanted to figure out where the problem was, and it seems it is with my query. Do you know what I'm doing wrong? It seems to drop one student off the first time you go to Print Preview, and you have to select all those same students again when you go back to the form in order to see them on the labels. HELP!

  6. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: CLEARING A CHECKBOX AFTER A REPORT (Access 2000)

    Before you go to the Print Labels button, can you check in the table as to which students have their Print flag set?
    Pat

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: CLEARING A CHECKBOX AFTER A REPORT (Access 2000)

    The problem is that the most recent selection hasn

  8. #8
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: CLEARING A CHECKBOX AFTER A REPORT (Access 2000)

    I would have had a continuous form showing just the records which you had set the Print flag.

    When you choose a record from the combobox I would check to see if the record's flag was set, then if so clear it, else set it (this provides a flip/flop method of setting/clearing the flag).

    After updating the record in the table I would then requery the form to keep showing the records which have been selected.

    The advantage is that you only have to choose the record to set (or clear) the flag.
    HTH
    Pat

  9. #9
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Canada
    Posts
    284
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CLEARING A CHECKBOX AFTER A REPORT (Access 2000)

    I tried it, and it works great! Thanks, Hans!

  10. #10
    3 Star Lounger
    Join Date
    Jun 2002
    Location
    Nottingham, Nottinghamshire, United Kingdom
    Posts
    257
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CLEARING A CHECKBOX AFTER A REPORT (Access 2000)

    I have a similar need for staff to be able to select certain people to report on. I solved it by using a list box set up for multiple selections and then used the selection to create a separate table for use as a mail merge source. I guess something similar would also work for an Access report.

    The code to loop through the list box selections was taken from an article by Helen Feddema in Woodys Access Watch around a year ago.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •