Hello world
I've just acquired a barcode scanner to use with my database
I'm now at the point of programming the form
Everything is working correctly except for one feature
I need everything in my barcode textbox to be selected (or deleted) after it has been updated.
It's basically so that I don't have to press the keyboard or mouse after scanning a barcode and can scan the next code if needed.
The scanner is programmed to add [enter key] after a successful scan so it enters the record and triggers AfterUpdate event.
doesn't work - but i the have SelStart/Length working ok with a MouseUp event.
should
go somewhere else instead?, or should i try a different approach?
I've just acquired a barcode scanner to use with my database
I'm now at the point of programming the form
Everything is working correctly except for one feature
I need everything in my barcode textbox to be selected (or deleted) after it has been updated.
It's basically so that I don't have to press the keyboard or mouse after scanning a barcode and can scan the next code if needed.
The scanner is programmed to add [enter key] after a successful scan so it enters the record and triggers AfterUpdate event.
Code:
Private Sub txtBarcode_AfterUpdate()
On Error Resume Next
Me.Form.Requery
Me.Form.Refresh
Dim Cformat As String
Cformat = DLookup("currencyformat", "tblagency", "agencyID = [forms]![frmbarcodesubform]![txtAgentID]")
Price.Format = Cformat
Me.txtBarcode.SetFocus
Me.txtBarcode.SelStart = 0
Me.txtBarcode.SelLength = Len(Me.txtBarcode.Text)
End Sub
should
Code:
Me.txtBarcode.SelStart = 0
Me.txtBarcode.SelLength = Len(Me.txtBarcode.Text)