Results 1 to 2 of 2

Thread: Printing a Form

  1. #1
    Join Date
    Mar 2004

    Question Unanswered: Printing a Form

    I have a small database table setup with about 400 items. I need to find a way to select an item and print labels for just that item.

    Find Item
    Print 10 labels
    Find Item
    Print 12 labels

    I tried adding the Printer Button, but that only prints the entire form.

    Thanks in advance.

    Bob G.

  2. #2
    Join Date
    Nov 2004

    VBA is the answer

    How good are you at VBA?? On the form create a combo box with the PK and what ever other fields that the user will need to identify the record that they want to print and another text box to input the number of labels to be printed and a button that says print.

    Since Access doesn't support temporary tables you will also need to create an empty table with the fields needed in the labels to be printed plus and autonumber for a PK for this table.

    Create a report useing the new table as the recordsource to print your labels

    With the onclick event of the button you created on the form create a recordset useing the selection in the combo box as the criteria and then useing the input as the number of copies make a loop that adds that record to your empty table as many times as indicated. (so the same record gets added over and over with only the autonumber being different) Once this loop has reached its exit point call the label report to be printed and then delete all records from the new table.

    You will also have to have the procedure check that the user has inputed both the combo box and the text field before exicuting and also don't forget to clear your recordset.

    Now if you want to be able to print multiple labels from multiple record selection it will be a little harder and you will need to use a list box instead of a combo box.

    If you don't know VBA let me know and I will do some for you but not until tomorrow.


Posting Permissions

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