Hi guys,
What the heck am I doing wrong? I am just about to give up. I still can't make this thing work. I just keep getting a "#name?" in the text box.
the entire code is listed and I am really getting frustrated.
Option Compare Database
Option Explicit
Function ALPHAONE() As String
Dim G As Single
Dim alphatwo As String
Dim upca(6)
For G = 1 To 6
If (Mid$(Forms![Copy of print upc symbols]![UPC SYMBOL], G, 1)) = "0" Then upca(G) = "A"
If (Mid$(Forms![Copy of print upc symbols]![UPC SYMBOL], G, 1)) = "1" Then upca(G) = "B"
If (Mid$(Forms![Copy of print upc symbols]![UPC SYMBOL], G, 1)) = "2" Then upca(G) = "C"
If (Mid$(Forms![Copy of print upc symbols]![UPC SYMBOL], G, 1)) = "3" Then upca(G) = "D"
If (Mid$(Forms![Copy of print upc symbols]![UPC SYMBOL], G, 1)) = "4" Then upca(G) = "E"
If (Mid$(Forms![Copy of print upc symbols]![UPC SYMBOL], G, 1)) = "5" Then upca(G) = "F"
If (Mid$(Forms![Copy of print upc symbols]![UPC SYMBOL], G, 1)) = "6" Then upca(G) = "G"
If (Mid$(Forms![Copy of print upc symbols]![UPC SYMBOL], G, 1)) = "7" Then upca(G) = "H"
If (Mid$(Forms![Copy of print upc symbols]![UPC SYMBOL], G, 1)) = "8" Then upca(G) = "I"
If (Mid$(Forms![Copy of print upc symbols]![UPC SYMBOL], G, 1)) = "9" Then upca(G) = "J"
Next G
alphatwo = upca(1) & upca(2) & upca(3) & upca(4) & upca(5) & upca(6)
ALPHAONE = alphatwo & Mid$(Forms![Copy of print upc symbols]![UPC SYMBOL], 7, 6)
ALPHAONE = Chr(91) & Left$(ALPHAONE, 6) & Chr(47) & Right$(ALPHAONE, 6) & Chr(93)
Debug.Print ALPHAONE
End Function
I have =ALPHAONE() in the control source of the text box.
The chr() are start and stop characters for the upc font.
so that 764724069780 returns [HGEHCE/069780](copied from the debug window)
I appreciate all the help and advice you have given.
Thanks
jpeneh10
Jim