Hi all, I have a fairly simple question... I think?
I have an inventory database that I use for keep track of stock. When the goods arrive I enter them on to the system, ie: kettle, x10 etc. I have a label that has the kettle information ie: supplier etc that prints out which I stick on the box.
How can I print out 10 labels based on the qty I have entered in to my database? I know I could print out 10 labels but can access do this for me?
Yes I could do that but the main reason I can't use that solution is that different products come in with different quantities.
There must be some kind of command/code thats like, DoCmd.OpenReport stDocName, acNormal x [qty]. can you see what I'm gettin at?
Thinking a bit more, if I printed a report could I get access to ask me "How many copies i wanted" and do it all with code?
I'm back again searching for another answer in relation to the above. The above worked perfectly when I only had single products booked in, but when I booked multiple products in on a continuous subform, only the top record printed out. See below:
AutoNum Product QtyReceived
1 Kettle 20
2 Toaster 15
I would like to print 20 kettle labels and 15 toaster labels with the click of a button.
Any Ideas how I can amend the code to print both records?
This is the code on the Labels Button which is on a form called GoodsReceivedDetail.
Private Sub Command203_DblClick(Cancel As Integer)
Dim i As Integer
Dim j As Integer
Dim stDocName As String
i = DLookup("[Qty]", "Products")
For j = 1 To i
stDocName = "ProductLabel1"
DoCmd.OpenReport stDocName, acNormal
This is the statement that the Report `ProductLabel1` is looking at:
SELECT Products.TurndullCode, Products.ProductDesc, Products.AMID, Products.SUPPLIER, Products.ProductAutoId, Products.SupplierModelId, Products.Image
In addition check out DLookup in help. It returns one value (the first it comes across) therefore your final solution is going to require something entering for the third argument of DLookup as you require the value for each item.