Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    118

    Unanswered: Cant get this VBA expression to work...

    Hi,

    I'm trying to do a very simple query and one of the fields needs to be changed to "open" or "closed" if it starts with 'P'.

    So I am writing this expression:

    list: if(DwgType.Table = 'p*',"Open","Closed")

    its returning an "undifined function "if" in expression" error.

    I'm sure this is something really silly, but could someone give me a hand please?

    Thanks

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Use IIF insted of IF

  3. #3
    Join Date
    Mar 2004
    Posts
    118
    Thanks, that moved things along, but for some reason it is only returning 'Closed'.


    IIf(([KE0G_Drawings].[DwgRevInt] = 'P*'),'Open','Closed') AS List


    Does anyone know what would cause that?

    Thanks

  4. #4
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100
    you need to use "like" instead of the equals sign.
    Access XP & WinXP Pro

  5. #5
    Join Date
    Mar 2004
    Posts
    118
    Thanks a lot!

    That worked like a charm

Posting Permissions

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