We help IT Professionals succeed at work.

How to print POS receipts in MS Access

514 Views
Last Modified: 2019-03-26
Hi

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.

Regards

Chris
Comment
Watch Question

John TsioumprisSoftware & Systems Engineer
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
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 .
CERTIFIED EXPERT

Author

Commented:
I know its possible to print a report using VBA but the problem is how to select the required invoice?
ste5anSenior Developer
CERTIFIED EXPERT

Commented:
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.
CERTIFIED EXPERT
Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
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.
CERTIFIED EXPERT

Author

Commented:
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?
CERTIFIED EXPERT
Most Valuable Expert 2015
Distinguished Expert 2018
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
ste5anSenior Developer
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT

Author

Commented:
Thank you all it has worked!

Regards

Chris

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.