Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Unanswered: Select from list and print

    Hey guys,

    Another problem. Seems you guys seem to fix my whole project for me!

    I have a list box from which you can select reports to print. What I don't know how to do is get the code to say print these when Cmd_Print is pushed.

    For example when I highlight the record, "Induction", I would like the report to run the following:


    All records in the table have a report with the same name + prefix "RPT_"

    At the moment the code says if Induction is selected print induction but the problem with this is that as more records are inputted I am going to need to keep adding if commands - something I dont want to have to do.

    Can anyone help?

  2. #2
    Join Date
    Feb 2003
    Auckland, NZ
    Add the following code:

        Dim stDocName As String
        stDocName = "RPT_" & listbox
        DoCmd.OpenReport stDocName, acNormal
    JJ Kennedy
    Double J IT Solutions

    VB 6, VB.NET, ASP.NET, MS SQL Server, MySQL, MS Access

Posting Permissions

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