Stuart McLachlan
stuart at lexacorp.com.pg
Mon Feb 13 21:48:03 CST 2006
On 13 Feb 2006 at 20:29, William Hindman wrote:
> ...have a need to print bar codes on badges that can be easily and reliably
> scanned at a trade show entrance.
>
> ...the database is A2K3 but the data is merged to WXP to print the badges.
>
> ...the badge bar codes are printed with HP LJ 4050s
>
> ...printing the bar codes in Word using code 39 font works well but doesn't
> produce the enter/exit control codes
>
You need to wrap the string in delimiters:
strCodeToPrint = "*" & strCode & "*" before merging to Word
> ...and how you've collected the data from the scanners.
>
Last time I did this was barcoded invitations for functions. They use a
handheld scanner on a "keyboard wedge".
To get the info into the correct place, I had a hidden text box on the form
and set Key Preview on. I surrounded the printed barcodes with "$"s
When the form detected a "$" being entered, it exposed the hidden text box,
and set focus to it. When a second "$" was detected, it closed the text box
and processed the input.
This worked fine as long as the form had focus. Best way to ensure that is
to set it modal, full screen.
Here's the main function:
Private Sub Form_KeyPress(KeyAscii As Integer)
Dim Inflow as Boolean
If KeyAscii = 36 Then ' $ sign
InFlow = Not InFlow
KeyAscii = 0
If Not InFlow Then
cboInvitees.SetFocus
txtInput.Visible = False
InFlow = False
If Len(txtInput) > 0 Then
LogGuest Val(txtInput), "Scanner"
cboInvitees = txtInput
End If
Else
InFlow = True
txtInput = ""
txtInput.Visible = True
txtInput.SetFocus
End If
End If
End Sub
Contact me off-list if you want a copy of the application.
--
Stuart