Ok here is some sample code, mostly provided by the MS knowledge base -
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q138774 (thanks to Jack Cowley for pointing it out in another post)
cmdReturn is the button you press to process the entry, and txtBarCode is the text field where the barcode appears (so you will need to replace those names). Everything else can stay as is.
Private Sub cmdReturn_Click()
Dim strChar As String, strHoldString As String, strBarCode As String
Dim i As Integer
txtBarCode.SetFocus
strBarCode = txtBarCode.Text
If strBarCode Like "*O*" Then
For i = 1 To 4
strChar = Mid$(strBarCode, i, 1)
Select Case strChar
Case "O"
strHoldString = strHoldString & "0"
Case Else
strHoldString = strHoldString & strChar
End Select
Next i
txtBarCode.Text = strHoldString
End If
End Sub
Good luck!
-Sean