Newbie; If Statement problem in Access 2007

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BlackEyedPea
    New Member
    • Dec 2009
    • 9

    #1

    Newbie; If Statement problem in Access 2007

    Hi, I'm still learning, slowly, but hopefully at least getting a little better!

    In essence all I want to do is find any barcodes in a field I have in a table that are only 7 digits long & add 6 0's to the front of barcode (therefore making those fields 13 digits long). I came up with the simple following which I thought might work...

    Code:
    Dim x6 As String
    x6 = "000000"
    If Len(AllTitles.[CountDigits] = 7) Then
      AllTitles.[CoBarcode] = x6 & AllTitles.[CoBarcode]
    Else
      AllTitle.[CoBarcode] = AllTitle.[CoBarcode]
    End If
    I keep getting a runtime error 424 - Object required. Its bound to be something dead simple but I've searched all morning for an answer & I'm floundering.

    Thanks a lot in advance of any advise.
    Last edited by Frinavale; Apr 26 '10, 01:40 PM. Reason: Please post code in [code] ... [/code] tags. Added code tags.
Working...