[Webinar] Streamline your web hosting managementRegister Today


MS Access How To Control and Open a POS Cash Register Cash Drawer With VBA

Published on
3,177 Points
Last Modified:
A quick solution showing how to control and open a POS Cash Register Drawer using VBA with MS Access.

Hello all! I wanted to share this quick tutorial to help anyone out who might be struggling with this same procedure. 

I will list what my setup is below and you can adapt it from there. Note that I am in no way an expert and quite frankly, am relatively new at this.  With that said...

My Setup

  • Access 2016
  • Windows 7
  • Par (APG) Brand Cash register drawer
  • USB to Printer Adapter Model BT-100U Found on Amazon AMAZON BT-100U LINK HERE
  • APG CD-101A Printer Cable Also found on Amazon AMAZON PRINTER CABLE LINK HERE
  • **APG CD-101A Printer Cable is a special cable with an RJ45 Ethernet cable on one end and an RJ11 (Phone Cable) end on the other.


When I plugged in my Adapter I made sure to have it connected to the register. 

The driver should come up as a "Prolific USB-to-Serial Comm Port (Your Com Port Here)" ***Remember which COM Port it says.

The following code is what I used to pop the drawer right open:

Private Sub OpenCashDrawer()
On Error GoTo Errorhandler
Dim LocationPort As String

LocationPort = "Com4" 'Replace Com4 with the com port you are using. Example is Com3, Com2, etc.....

Open LocationPort & ":9600,n,8,1" For Output As #1
Print #1, "" 'This is just sending a signal like it is printing something but it is not.
Close #1

Exit Sub
MsgBox "Error " & Err.Number & ": " & Err.Description & " in " & _
VBE.ActiveCodePane.CodeModule, vbCritical, "Error in btnOpenCashDrawer_Click"
End Sub

This worked for me, so I hope this helps someone out.


Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Join & Write a Comment

In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month