Generating a barcode for print


I am writing a program and i need to print labels with a barcode on it.

I was hoping to use the UPC-A barcode type as they are currently using that with a similar program.

I know i need a barcode font, but correct me if i am wrong, but dont you need to generate a start, stop and check digit to be added to the barcode? how would i go about this if so?


Who is Participating?
The start and stop bars are part of the font.  The check digit needs to be calculated by you.  Try this link for method of calculation:-
why don't you use this's very good one

bryanfordAuthor Commented:
Thanks, i wasnt aware that the start and stop were in the font (should read the bloody manual i guess :p )

I did a search for check digit calculation source code and found this. It seems to work OK:

Public Function calcModulus10(ByVal sNumber As String) As Integer
Dim tmpTotal As Integer
Dim i As Integer, f As Byte, tmpStr As String
Dim mdNums() As Integer
For i = 1 To Len(sNumber)
  f = f + 1
  If f = 2 Then
    tmpStr = CInt(Mid$(sNumber, i, 1)) * 2
    If Len(tmpStr) > 1 Then
      tmpTotal = tmpTotal + CInt(Mid$(tmpStr, 1, 1)) + CInt(Mid$(tmpStr, 2, 1))
      tmpTotal = tmpTotal + CInt(tmpStr)
    End If
    tmpStr = ""
    f = 0
    tmpTotal = tmpTotal + CInt(Mid$(sNumber, i, 1))
  End If
Next i
If Right$(CStr(tmpTotal), 1) = "0" Then
  tmpTotal = 0
  tmpTotal = ((tmpTotal + 10) - CInt(Right$(CStr(tmpTotal), _
1))) - tmpTotal
End If
calcModulus10 = tmpTotal
End Function

Thanks again
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.