Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jun 2003
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Printing some labels (Access 2000)

    I have a form, based on a query which returns a subset of people
    I have a button to produce address labels using a report created by the wizard
    Clicking the button produces labels for every person inthe database
    I know how to produce a label for one individual but how can I limit the labels to those that are produced by the query

  2. #2
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Printing some labels (Access 2000)

    Follow these steps:

    1. Open db with "Queries" selected in Objects pane.

    2. Select query to be used as RecordSource for label report.

    3. From Select Object list (Database toolbar) select "Report". Or, select "Report" from Insert menu.

    4. New Report dialog will open. Select "Label Wizard" from list of options. The query you selected should appear in the "Choose table or query" combobox.

    5. "Label Wizard" dialog will open. Follow instructions to create new label report based on specified query.

    6. Click "Finish" button when done. New report will be created, reflecting the options you selected in "Wizard."

    7. View report in design or preview mode, and make any necessary changes to formatting, etc.

    8. Print labels.

    HTH

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Printing some labels (Access 2000)

    Another way is to create a WhereCondition string you can use in your OpenReport method. Let's assume the Primary Key field is named ID, and is a number. You want to produce a string that looks something like this:
    ID in (1,5,7,100,2500)

    This code will create that string (this will fail if the # of ID causes, the string to exceed it max length, which is some 4000 characters):

    dim strIN as string

    strIN = "ID in ("
    with Me.recordsetclone
    .moveFirst
    Do While .EOF=False
    strIN = strIN & ID & ","
    .MoveNext
    Loop
    strIN = strIN & ")"
    End With

    DoCmd.OPenReport "rptLabels",wherecondition:=strIN
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    New Lounger
    Join Date
    Jun 2003
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing some labels (Access 2000)

    Thanks for the replies - my mistake was creating the form based on the table - not the query - it's now working fine

Posting Permissions

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