• Concatenation problem (Access 2002)

    Author
    Topic
    #405698

    Hey gang!

    Having some difficulty getting a concatenation to work properly. I’d really appreciate someone’s help.

    In the attached gif, you will find some code, screenshoot of an access table and an error message. I’m trying to create a filename (complete with path) from data found in the table. I’m using DLookup to capture the information out of the table. I’ve trying playing with the placement of quotemarks, etc, but Access doesn’t seem to be concatenating it. I’m sure I just have a misplaced quotemark somewhere.

    Viewing 1 reply thread
    Author
    Replies
    • #835713

      You have put an expression in the FileName field in the table. The DLookup to fill strFileName will retrieve the literal text of the expression, it won’t evaluate it. I suggest just putting FolderSize_ in the FileName field, and to use this:

      strFileName = DLookup(“FileName”, “tblConfig”, “UseThisConfig = True”) & Format(Date, “yyyymmdd”) & “.xls”

      By moving the variable part to the code itself, you allow Access to evaluate it.

    • #835714

      You have put an expression in the FileName field in the table. The DLookup to fill strFileName will retrieve the literal text of the expression, it won’t evaluate it. I suggest just putting FolderSize_ in the FileName field, and to use this:

      strFileName = DLookup(“FileName”, “tblConfig”, “UseThisConfig = True”) & Format(Date, “yyyymmdd”) & “.xls”

      By moving the variable part to the code itself, you allow Access to evaluate it.

    Viewing 1 reply thread
    Reply To: Concatenation problem (Access 2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: