Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Feb 2003
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    send only certain records to print (2003)

    I have an entry form set up, with a command button that says merge with a label setup in a report and then print. My problem is that the user wants to be able to go through and make changes in different records, and then only print those records in which changes were made at that time. So I would like some way to mark those records to be printed. If the user goes into four different records and makes changes, those are the four records I want to merge with the label setup and print. I know it's probably something easy but I just don't know what. It's because it's a label setup that I can't print each record separately, they want to print all on the same label sheet.
    Does anyone have any suggestions? Thank you.

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

    Re: send only certain records to print (2003)

    One possibility is to add a Yes/No field IsModified to the table. In the Before Update event of the form, set the value of this field to True. In the instruction to open the label report, add a WhereCondition argument:

    DoCmd.OpenReport ReportName:="rptLabels", View:=acViewPreview, WhereCondition:="IsModified = True"

    You also need to reset the IsModified field to False; you can do this either when the form is opened, or perhaps when the form is closed.

    Warning: if multiple users will be editing the records and printing labels simultaneously, the above won't work, at least not as intended.

  3. #3
    Star Lounger
    Join Date
    Feb 2003
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: send only certain records to print (2003)

    Hans
    Would it be possible for you to look at my database and help me? I'm not very good with modules and code. If you can't, can you just tell me what to put in the Before Update line of the form? I also wonder if the command button to print the labels could open the label setup first so the user could see it instead of going right to the printer?? Thanks alot.

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

    Re: send only certain records to print (2003)

    See attached version. Don't overwrite your own database, I removed forms and reports not necessary for this problem. The Before Update event procedure for the form looks like this:

    Private Sub Form_BeforeUpdate(Cancel As Integer)
    Me.IsModified = True
    End Sub

    To open the report, this instruction is used:

    DoCmd.OpenReport "5196 labels", acViewPreview, , "IsModified = True"

    The second argument acViewPreview specifies that the report is opened in preview mode instead of being sent directly to the printer. The fourth argument is the filter.

  5. #5
    Star Lounger
    Join Date
    Feb 2003
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: send only certain records to print (2003)

    Hans,
    This is exactly what I needed. Thank you so much and thanks for explaining it. I'm going to try it on another label setup so hopefully I will understand this a little better by working with it.

Posting Permissions

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