• Print Multiple Labels in Varying Amounts (2002 XP)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Print Multiple Labels in Varying Amounts (2002 XP)

    Author
    Topic
    #427312

    I am creating a database which prints HMIS labels. Multiple labels are chosen from a list box on a form, “frmLabel2x2”.
    When I click the Preview button on the form the report runs code which prompts for which label to start with, (position on sheet of labels).
    Then the report opens in preview mode.

    I want to be able to select how many copies of each label selection to print.
    For example, I want to print 2 copies of the first label, 6 copies of the second label and 1 copy of the third label.

    I have a “Qty” field in the table “MAINTENANCE” and the query “qryMultiSelectCriteria”.
    But I don’t know how to update/change the Qty field in the form “frmLabel2x2” or the list box “lstItem”.

    I have attached the database, Labels3.mdb. It is in Access XP (2002).

    Viewing 0 reply threads
    Author
    Replies
    • #989765

      Your report is based on qryHMIS, not on qryMultiSelectCriteria. Start by adding Qty to qryHMIS too.
      Next, put a text box bound to Qty in the Detail section of the report. Set its Visible property to No.
      Adapt the code as follows:
      1) In the On Print event of the Detail section of the report:

      ls_DetailOnPrint Me, Me.Qty

      2) In the header of the ls_DetailOnPrint procedure in the basLabelSaver module:

      Sub ls_DetailOnPrint(rpt As Report, iLSCopiesToPrint As Integer)

      See attached version.

      • #989777

        Thank you for your response. If I go into the table MAINTENANCE and change the Qty field value, then the multiple labels print correctly.

        However, I want to be able to change the labels quantity for each item selected on the form. Or some other way if you have another idea.

        The user is going to require a different count of labels each time for each item selected.

        • #989780

          Provide a continuous form in which the user can edit the Qty field.

          • #990678

            Thank you for your suggestion. I have implemented your suggestion.

            I would now like to be able to click a button and set the field [bolSelect], a Yes/No checkbox field so that all records are set to No (False).

            How does one go about doing this? I have attached the database in XP format.

            • #990680

              Assuming that you only want to clear bolSelect for the filtered records (if a filter has been applied):

              Private Sub cmdClearSelectToPrint_Click()
              Dim strSQL As String
              strSQL = “UPDATE qryHMIS SET bolSelect = FALSE ”
              If Me.FilterOn And Not Me.Filter = “” Then
              strSQL = strSQL & “WHERE ” & Me.Filter
              End If
              DoCmd.SetWarnings False
              DoCmd.RunSQL strSQL
              DoCmd.SetWarnings True
              Me.Requery
              End Sub

            • #990688

              Thank you, thank you. Works great!

    Viewing 0 reply threads
    Reply To: Print Multiple Labels in Varying Amounts (2002 XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: