Hi,
I have to create a simple report (multiple smaller cards per sheet -- see the picture attached -- red circle represents the next record)
but I'm struggling to implement a good way to create more than one report per button click.
My idea is to open a MsgBox, the user can enter some integer (example: 1,5,9,10,12) and the VBA command
generates a report with "ID=1", "ID=5" and so on ... so I have the at maximum 8 smaller reports per A4 sheet
What I have so far is this:
This works correctly what do I have to change to include more "IDs"? I could go on like this:
and if the user uses a syntax like this "1,5,9,10,12" I could remove the commas, create an array and use it within the where clause.
Unfortunately I did not worked with VBA for over a year so I forgot a lot of the useful stuff. Maybe you can help as I guess it's not a difficult problem and
could be solved easily.
Thank you in advance!
Best regards
Moritz
PS: I attached my little project as well so it might be easier to follow my problem
(talking about the kan_Utilities report)
PSS: This is the SQL query I use to generate the report
I have to create a simple report (multiple smaller cards per sheet -- see the picture attached -- red circle represents the next record)
but I'm struggling to implement a good way to create more than one report per button click.
My idea is to open a MsgBox, the user can enter some integer (example: 1,5,9,10,12) and the VBA command
generates a report with "ID=1", "ID=5" and so on ... so I have the at maximum 8 smaller reports per A4 sheet
What I have so far is this:
Code:
DoCmd.OpenReport "kan_Utilities", acViewPreview, , "ID=" & 2
This works correctly what do I have to change to include more "IDs"? I could go on like this:
Code:
Dim answer As String
answer = MsgBox("Please enter the values?", vbQuestion + vbYesNo + vbDefaultButton2, "Report")
and if the user uses a syntax like this "1,5,9,10,12" I could remove the commas, create an array and use it within the where clause.
Unfortunately I did not worked with VBA for over a year so I forgot a lot of the useful stuff. Maybe you can help as I guess it's not a difficult problem and
could be solved easily.
Thank you in advance!
Best regards
Moritz
PS: I attached my little project as well so it might be easier to follow my problem

PSS: This is the SQL query I use to generate the report
Code:
' SELECT Utilities.ID, Utilities.Description, Utilities.Size, Supplier.Supplier, Utilities.OrderNumber, Utilities.Comment, Cabinet.Cabinet, Utilities.WorkingLength, Utilities.InActive, Utilities.Price, Utilities.OrderSize, Utilities.Minimum, Utilities.Comment, Utilities.OrderNumber, Utilities.Regrind, Untergrenze.Untergrenze AS Ausdr1
' FROM Category, Supplier INNER JOIN (Floor INNER JOIN (Cabinet INNER JOIN Utilities ON Cabinet.ID = Utilities.CabinetFK) ON Floor.ID = Utilities.FloorFK) ON Supplier.ID = Utilities.SupplierFK
' WHERE (((Utilities.ID)=2 Or (Utilities.ID)=3));