Hi,
Im trying to get to grips with VBA in Access 97, im currently trying to write a small MSComm module that we can bolt on to various db's in house.
The last time I touched access was well over 12 months ago and that was a very basic bit of code so im going into this blind.
At the minute all I am trying to do is scan a serial number with a serial scanner and then print the barcode in a text box, I can't get it to work though and im sure its something simple I am missing.
So far I have the following
Setting the scanner
Displaying a scanned barcode.
I've looked all over the net for a example of what im after but I can't find anything, what am I missing?
Im trying to get to grips with VBA in Access 97, im currently trying to write a small MSComm module that we can bolt on to various db's in house.
The last time I touched access was well over 12 months ago and that was a very basic bit of code so im going into this blind.
At the minute all I am trying to do is scan a serial number with a serial scanner and then print the barcode in a text box, I can't get it to work though and im sure its something simple I am missing.
So far I have the following
Setting the scanner
Code:
Public Sub Scanner_Settings()
With Me.MSComm1
'Use COM Port 1
.CommPort = 1
'Sets and returns the hardware handshaking protocol. Data is transferred from the hardware port to the receive buffer
.Handshaking = comXOnXoff
'9600 baud, no parity, 8 data, and 1 stop bit.
.Settings = "9600,N,8,1"
'Sets and returns the number of characters the Input property reads from the receive buffer.
.InputLen = 30000
'Sets the type of data retrieved by the Input property.
.InputMode = comInputModeText
End With
Me.MSComm1.PortOpen = True
End Sub
Displaying a scanned barcode.
Code:
Private Sub MSComm1_OnComm()
Dim Barcode As String
MSComm1.Input = Barcode
Me.Text1.SetFocus
Me.Text1.Value = Barcode
End Sub
I've looked all over the net for a example of what im after but I can't find anything, what am I missing?