Sample of VBA to export inventory table. (1 Viewer)

hfsitumo2001

Member
Local time
Today, 15:47
Joined
Jan 17, 2021
Messages
365
I want to make inventory location mark in one paper like below. The way I make it is to export inventory table in excel and then I merge with the Publisher form/paper. Can anyone give me the VBA for click button to export the inventory table?. I want just to press one button in Admin form which is my form and do export.
Is there any way we do merging in MS Access environment?

Thank you
 

Attachments

  • Inv_Bin.pdf
    262.2 KB · Views: 210

namliam

The Mailman - AWF VIP
Local time
Today, 23:47
Joined
Aug 11, 2003
Messages
11,696
How about creating a report and printing it to a PDF printer?
 

Kayleigh

Member
Local time
Today, 22:47
Joined
Sep 24, 2020
Messages
706
Try this VBA:
DoCmd.OutputTo acOutputReport, "Inv_Bin", _
acFormatPDF,"C:\Users\desktop\PDFs\Report1.pdf"
 

hfsitumo2001

Member
Local time
Today, 15:47
Joined
Jan 17, 2021
Messages
365
Try this VBA:
DoCmd.OutputTo acOutputReport, "Inv_Bin", _
acFormatPDF,"C:\Users\desktop\PDFs\Report1.pdf"
Krayna, actually the attachment you see is not in pdf, I just scan my sample in pdf and I send it in this forum. The one that you see I did it like this. I exported my table inventory then I merged it with my MS Publisher template, and in merging process there is a time to ask us which records that we want to merge then I chose and we can preview them than I printed.
My question , can we make the report so fancy like the template that I made in publisher?
 

Kayleigh

Member
Local time
Today, 22:47
Joined
Sep 24, 2020
Messages
706
Sorry, yes I definitely think it is possible to do this natively in Access. You can base report on specific query if you only want specific records.
If you use the line tool, you can achieve your illustrated border.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 18:47
Joined
May 21, 2018
Messages
8,463
My question , can we make the report so fancy like the template that I made in publisher?
That looks pretty simple to make. There is a rectangle object to make the border.
 

hfsitumo2001

Member
Local time
Today, 15:47
Joined
Jan 17, 2021
Messages
365
Sorry, yes I definitely think it is possible to do this natively in Access. You can base report on specific query if you only want specific records.
If you use the line tool, you can achieve your illustrated border.
Thanks Krayna, I will give it a try.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 18:47
Joined
May 21, 2018
Messages
8,463
Here is a quick example

Clipboard01.jpg
 

Attachments

  • rptDemo.pdf
    43.1 KB · Views: 177
  • DemoReport.accdb
    724 KB · Views: 145

hfsitumo2001

Member
Local time
Today, 15:47
Joined
Jan 17, 2021
Messages
365
Thank you MajP, I will do like that and I will try to make query to choose which one to print
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 18:47
Joined
May 21, 2018
Messages
8,463
MajP, how can you do it so fast
For the demo. I picked an existing table and selected create report. It automatically builds the report with the controls. Then just moved the text boxes and resized them. A couple minutes. I selected a rectangle and made the background (transparent. Change from normal so it is not filled in). Hit copy twice and used the arrows to size. a couple more minutes. It may looks fancy with the borders, but very simple.

If you do not have a very large amount you can also simply make a pdf of all. Then select from the PDF the page you want to print.
 

hfsitumo2001

Member
Local time
Today, 15:47
Joined
Jan 17, 2021
Messages
365
For the demo. I picked an existing table and selected create report. It automatically builds the report with the controls. Then just moved the text boxes and resized them. A couple minutes. I selected a rectangle and made the background (transparent. Change from normal so it is not filled in). Hit copy twice and used the arrows to size. a couple more minutes. It may looks fancy with the borders, but very simple.

If you do not have a very large amount you can also simply make a pdf of all. Then select from the PDF the page you want to print.
Thank you MajP, Yes I have made it, and the data is from inventorytable, but do you have anyway to filter which itemcode to print?
 

hfsitumo2001

Member
Local time
Today, 15:47
Joined
Jan 17, 2021
Messages
365
For the demo. I picked an existing table and selected create report. It automatically builds the report with the controls. Then just moved the text boxes and resized them. A couple minutes. I selected a rectangle and made the background (transparent. Change from normal so it is not filled in). Hit copy twice and used the arrows to size. a couple more minutes. It may looks fancy with the borders, but very simple.

If you do not have a very large amount you can also simply make a pdf of all. Then select from the PDF the page you want to print.
Again Thank you MajP, I made it and with the selection filter to print which one we want to print, and it works. Thank you very much
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 18:47
Joined
May 21, 2018
Messages
8,463
You beat me, but here is a simple idea. Open the report and use the right mouse to export in the format you want.

export.jpg
 

Attachments

  • DemoReport2.accdb
    756 KB · Views: 183

Users who are viewing this thread

Top Bottom