Results 1 to 15 of 15
  1. #1
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Select options (Choose items to print)

    I created a simple for in which the user can select a range of invoices to print by means of a query. This is working fine, and all details print on one page which the customer wants. In some cases, an invoice might not be sent eg, we might select 101 to 110, but 108 is not wanted. If we selected 101 to 107, and then 109 to 110, they print on seperate sheets as expected. Is it possible that, when after we select From and To, another form opens with tick boxes for the selected range, so if one item is not required, it can be unchecked. I don't know how complicated this would be to do, but it would solve our problem. Cheers.

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

    Re: Select options (Choose items to print)

    the attached database demonstrates how to use a multi-select list box to select/deselect individual items to be displayed in a report.

  3. #3
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Select options (Choose items to print)

    That's just the kind of thing I'm after. Because of the size of our tables though, I need to create a make table query (which I've done) which will just put the required Invoices in a table, and then automatically open the selection form, and from there, the report.

  4. #4
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Select options (Choose items to print)

    Does the number two in this line of code from the Event procedure of the OK button, have influence on the report?

    strFilter = "InvoiceNo In(" & Mid(strFilter, 2) & ")"

    as when I run the form, and select the invoices, I'm asked for the Invoice Numbers again.

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

    Re: Select options (Choose items to print)

    The field name in that line (InvoiceNo) must correspond exactly to the name of the field in the record source of the report. If the field name is Invoice Numbers, try

    strFilter = "[Invoice Numbers] In(" & Mid(strFilter, 2) & ")"

  6. #6
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Select options (Choose items to print)

    That could be the problem. The Invoice Number doesn't actually appear for every line item. If we have a couple of invoices for the same part, they are grouped together on the report to just give a total quantity and value. The invoice numbers are just used as a report header ( Invoice No's 100-110,113,117) etc. All details are grouped together so we have fewer lines on the report. Is this why the report askes me for the numbers? The actual process of selecting the Invoices is working fine, it's just the report thats the problem. I've checked the filter property on the report after it has run, and it's giving the right information.

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

    Re: Select options (Choose items to print)

    Where do the Invoice Numbers come in? Are they stored in a table, or calculated in a query, or...?

  8. #8
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Select options (Choose items to print)

    The invoice details are stored in a large table, so I use a 'make table query' to extract just the range we want, into another table, and this seems to work. Then I run the selection form, and it brings up all the range in the table for me to select, but then asks me for the details when the report runs. But the funny thing is, if I then double click on the report, it opens up with the details in it!

  9. #9
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Select options (Choose items to print)

    Could it be that our invoice numbers begin with I, and are therefore text?

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

    Re: Select options (Choose items to print)

    In the demo I posted yesterday, the line

    strFilter = strFilter & "," & Me.lstInvoices.ItemData(varItem)

    should be changed to

    strFilter = strFilter & "," & Chr(34) & Me.lstInvoices.ItemData(varItem) & Chr(34)

    if you're working with a text field. Chr(34) is the double quote character ".

  11. #11
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Select options (Choose items to print)

    That's excellent Hans. Thank you very much. Is there a way of using the filter results as text box in the report to state what invoices are included, or would it be easier to have a parameter field?

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

    Re: Select options (Choose items to print)

    You can put a text box in the report header or footer with control source =[Filter]

  13. #13
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select options (Choose items to print)

    I've just had a look at this and I can't figure out how you get the continuous report to have two columns.

    What (probably obvious thing) am I missing?

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

    Re: Select options (Choose items to print)

    Open the report in design view.
    Select File | Page Setup...
    Activate the Columns tab.
    You'll see that the number of columns has been set to 2, and that column layout is down, then across.
    The labels in the page header section have been duplicated, and I adjusted their position manually.

  15. #15
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select options (Choose items to print)

    Thankyou

    I can't believe how many times in the past I must have been into the page setup dialog without really noticing the columns tab. I think I've looked at at every property of the all controls and sections on your report but didn't go to page setup!


    Thanks again

Posting Permissions

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