Results 1 to 4 of 4
  1. #1
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398

    syntax for if then statement

    I'm having difficulty with the syntax on an if then statement.

    This works:
    If Not IsNull(Me.Budget) Then
    Me.Budget.Enabled = False


    Else
    Me.Budget.Visible = False
    Me.Combo44.Visible = True
    End If

    I need to change the first line to being:
    If Not IsNull(Me.Budget) or Me.Budget <> "Clarification Needed" then

    This is not working. What should be the correct syntax? Thanks in advance!!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Try And instead of Or.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Thanks for the suggestion. That worked!!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    No problem. When you use <> instead of =, it reverses the logic.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Syntax of rs.Open Statement
    By Philosophaie in forum Access
    Replies: 5
    Last Post: 07-05-2013, 06:24 PM
  2. If statement syntax help!
    By Richie27 in forum Programming
    Replies: 15
    Last Post: 06-15-2012, 12:58 AM
  3. Replies: 7
    Last Post: 08-17-2011, 01:49 PM
  4. IIf Statement Syntax Error
    By shexe in forum Queries
    Replies: 2
    Last Post: 10-06-2010, 08:35 AM
  5. Select statement syntax?
    By ksmith in forum Programming
    Replies: 3
    Last Post: 06-24-2010, 09:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums