I have found 2 pieces of code on the internet that should open COM3 and fire a kick to open a cash drawer. The code is in VB, but I want to use this in an access database. The code is
1.)
Dim iFile As Integer
Dim arrbData() As Byte
iFile = FreeFile
Open "COM3" For Binary Access Write As #iFile
ReDim arrbData(1 To 4)
arrbData(1) = &H1B '27 in hexadecimal
arrbData(2) = &H70 '112 in hexadecimal
arrbData(3) = &H0 '0 in hexadecimal
arrbData(4) = &H30 '48 in hexadecimal
Put #iFile, , arrbData
arrbData(3) = &H1
arrbData(4) = &H31
Put #iFile, , arrbData
Close #iFile
2.)
Open "COM3" For Output As #1
Print #1, Chr$(27); Chr$(112); Chr$(0)
Close #1
But I can not get either to run. I have attached the DB.
Is it pos to run VB in access and if so how. Would this code even work to fire a cash drawer
1.)
Dim iFile As Integer
Dim arrbData() As Byte
iFile = FreeFile
Open "COM3" For Binary Access Write As #iFile
ReDim arrbData(1 To 4)
arrbData(1) = &H1B '27 in hexadecimal
arrbData(2) = &H70 '112 in hexadecimal
arrbData(3) = &H0 '0 in hexadecimal
arrbData(4) = &H30 '48 in hexadecimal
Put #iFile, , arrbData
arrbData(3) = &H1
arrbData(4) = &H31
Put #iFile, , arrbData
Close #iFile
2.)
Open "COM3" For Output As #1
Print #1, Chr$(27); Chr$(112); Chr$(0)
Close #1
But I can not get either to run. I have attached the DB.
Is it pos to run VB in access and if so how. Would this code even work to fire a cash drawer