Results 1 to 4 of 4
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919

    I need to create an expression within the design view of a query.


    I need to create an expression within the design view of a query.

    The expression needs to evaluate to True or False.

    The underlying table has four fields of interest. Namely "RegAs", "Regular", "HomePhone" and "CellPhone".

    The logic is as follows:

    If RegAs = "Hd of HseHold" AND Regular = True AND (IsNot Null HomePhone
    OR IsNot Null CellPhone) Then bolAllGroup = True

    What would be the expression syntax to be coded in the expression builder?

    Can I name the expression, like "bolAllGroup"? I.e., I think the default would be something like "Exp1:".

    Thanks
    Bill

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    This will evaluate to true or false, but will be -1 or 0

    Code:
    bolAllGroup: [RegAs]="Hd of HseHold" And [Regular]=True And (Not IsNull([HomePhone]) Or Not IsNull([CellPhone]))
    Paste this in a empty column of the query designer.

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    PERFECT!!!

    I had to laugh when I noticed what I'd written about "Not IsNull".

    Thanks,
    Bill

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Wonderful!!!

    I've typed it the same way as you.... Then head slapped myself.

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

Similar Threads

  1. Replies: 5
    Last Post: 09-05-2012, 01:21 PM
  2. Replies: 1
    Last Post: 07-31-2012, 02:03 PM
  3. Query - Design View
    By Rick West in forum Queries
    Replies: 4
    Last Post: 04-09-2012, 04:09 PM
  4. Unable to view query in design view
    By vemi007 in forum Queries
    Replies: 7
    Last Post: 01-19-2012, 11:36 AM
  5. Using a Design View Query in ADO?
    By danny2000 in forum Access
    Replies: 4
    Last Post: 12-06-2010, 03:36 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