none
Format Function Error - Expected Array RRS feed

  • Question

  • I keep getting an error when I try to format this number. I've done it in VBA before and I tried to change the SOPID to a variant, a string, and an integer.

        Dim SOPID As Integer
        SOPID = DMax("file_id", "tblSOP") + 1
            
        'Output test data
        MsgBox (format(SOPID, "000"))
    I have no idea what I am doing wrong.
    Monday, November 4, 2019 4:02 PM

All replies

  • Hi,

    Before using Format function, you need to check if the value of SOPID is integer.
    MsgBox "SOPID = " & SOPID

    Regards,

    Ashidacchi -- http://hokusosha.com

    Tuesday, November 5, 2019 12:04 AM