Results 1 to 4 of 4
  1. #1
    MFS is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2009
    Location
    Ohio
    Posts
    235

    Basic If Statement Help

    I'm not sure how to write this statement.
    If [text1]&[Text2]&[Text3] are not null then



    I'm sure its easy, but still learning

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Maybe something like ...

    Code:
    If not isnull(Me.ControlName1.Value) and not isnull(Me.ControlName2.Value) and not isnull(Me.ControlName3.Value) then
    msgbox "All controls are initialized"
    else
    msgbox "One or more controls are not initialized"
    end if

  3. #3
    MFS is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2009
    Location
    Ohio
    Posts
    235
    Thank You ItsMe,
    Perfect

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    You bet. Also, you can use parenthesis around a comparison operator to indicate precedence. For instance us the OR operator and apply that first.

    I think it would look something like this ...
    Code:
    If (not isnull(Me.ControlName1.Value) OR not isnull(Me.ControlName2.Value)) and not isnull(Me.ControlName3.Value) then

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

Similar Threads

  1. Replies: 11
    Last Post: 04-29-2015, 01:38 PM
  2. Basic If Statement Not Working
    By RawToast in forum Access
    Replies: 1
    Last Post: 12-22-2014, 12:16 PM
  3. Replies: 6
    Last Post: 02-24-2014, 09:26 AM
  4. Replies: 2
    Last Post: 10-13-2011, 09:14 AM
  5. Replies: 7
    Last Post: 08-17-2011, 01:49 PM

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