troubleshooting Question

How to allow Multiple usage of the serial port- Ms Access 2016/2019

Avatar of Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScFlag for Zambia asked on
Microsoft Access
1 Comment1 Solution9 ViewsLast Modified:
After working very well and successfully with the serial port for the purpose of tax invoices production by attaching the gadget to one user all was very fine no issues at all, now the manufacturer added a new feature which allows the gadget to be shared on the network by four extra users provided the users are on the same network.
We are using a router meaning essentially, we are on the same network, but the gadget cannot be opened by another user except where it is attached, we contacted the gadget supplier and their response is that, just ensure you are all on the same network and call
Below is the VBA we are using to open the gadget:
Public Sub CmdCOpen_Click()
On Error GoTo Err_Handler
Dim Cancel As Integer
Dim intPortID As Integer ' Ex. 1, 2, 3, 4 for COM1 - COM4
Dim lngStatus As Long
Dim strError  As String
If IsNull(Me.CboInvoices) Then
MsgBox "Please select the invoice number to sign off now", vbOKOnly, "Invoice number not selected"
Cancel = True
Exit Sub
ElseIf (DLookup("InvoiceNumber", "tblDreceipts", "INVID =" & [CboInvoices]) <> "") Then
MsgBox "Please note that this invoice is already signed by the gadget, select another one", vbOKOnly, "Try again"
Cancel = True
Exit Sub
End If
intPortID = Forms!frmLogin!txtFinComPort.value ‘ COM 4
' Initialize Communications
lngStatus = CommOpen(intPortID, "COM" & CStr(intPortID), "baud=115200 parity=N data=8 stop=1")
If lngStatus <> 0 Then
' Handle error.
MsgBox Err.Number & Err.Description, vbExclamation, "Error"
ElseIf lngStatus = 0 Then
MsgBox "Please note that the port is open now", vbOKOnly, "Start processing the invoice details now"
End If
' Set modem control lines.
lngStatus = CommSetLine(intPortID, LINE_RTS, True)
lngStatus = CommSetLine(intPortID, LINE_DTR, True)
Call CmdCwrite_Click
Call SleepTest
Call CmdCread_Click
Call CmdClose_Click
Exit Sub
Do we need to amend it somehow?
Gadget Details from the supplier.
The gadget device provides ethernet port serial communication ports for data transmission.
The gadget provides two connection mode which are Ethernet and serial. For serial connection, two serial ports include (USB to TTL) and RS232 are supported. The POS system should set the right port for communication before transaction data transmission. For Ethernet connection, the gadget must get IP address by assistant tool which provide static IP and DHCP mode.
Senior Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros