Consulting

Results 1 to 2 of 2

Thread: Format Function Error - Expected Array

  1. #1
    VBAX Regular
    Joined
    Jul 2019
    Posts
    51
    Location

    Format Function Error - Expected Array

    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.

  2. #2
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    This works for me
    Dim x As Integer
    x = 11
    MsgBox Format(x, "0000")

    I get 0011

    Which suggests that the outer brackets you used force Access to expect a function outside them.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •