Avatar of Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Flag for Zambia asked on

How to print POS receipts in MS Access


My point of sales receipts is compiled from queries that gather the following:
(1)      Taxes
(2)      Quantity sold & prices
(3)      Other calculations
So in short it is not possible to use the current form to act as a receipt report. These queries are the one providing data for the receipt report, that is why currently to print a receipt report you need to close the current input form and open the parameter query form.
Now I’m wondering if there could a better way of binding the parameter query using the input form so that people do not need to close the current input form but can just invoke the printing of a receipt from the same input form.

I Thought MS Access save data into the table immediately after leaving a control, if yes how can I use the current primary key of the current receipt form as part of the parameter query so that the document printed is the current document showing on the input form screen?
I want to maintain the current form parameter query because sometimes the document may fail to print, then with the current parameter form query available I’m able to preview the document and reprint it.

I know it is possible to attach a macro to either print directly to the printer or preview the document by using the built in macro wizard, but the problem is how to the current document I’m not sure here because this macro wizard will only ask for the report to be printed, this means that I will end will all receipts being printed.

Could it be that there is VBA function to use here?

See how you can help here.


ACTPrinters and ScannersMicrosoft AccessSales

Avatar of undefined
Last Comment
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc

8/22/2022 - Mon
John Tsioumpris

Without inside knowledge of your application is hard to speculate but if many calculations are involved probably s good idea would be to consolidate all your desired output data to a temp table that Will act as your report recordsource .
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc

I know its possible to print a report using VBA but the problem is how to select the required invoice?

I would go a step further:

Receipts are fiscal relevant. Thus they must be materialized in a normal table before printing. So everything printed on it, should be calculated and stored in that table after the sale is done. And then you print it just from this table.

Another benefit: You get a second auditable trail in your system for free.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Gustav Brock

We do as Stefan does. Writing to the final table is where the invoice/receipt number is applied.
The details (invoice lines) are written to a subtable.

Then, all you need to do is to print the receipt (report) based on that single number.
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc

All what you have said is already in both parent receipt table and receipt detail line table , all what I'm saying is how to fine tune the code below, so that I'm able to print the current receipt number after creation:

Private Sub SalesPrintDoc_Click()
DoCmd.OpenReport “rptSalesInvoice”, acViewPreview, , “invoiceID = ” & Me.invoiceID
DoCmd.PrintOut , , , , 1
End Sub

I do not know why it is not working?

I want also to be able to mark the printed copy as copy receipt and the first time print as original. Is there a way to amend the above code?
Gustav Brock

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc

Thank you all it has worked!


Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.