Results 1 to 8 of 8
  1. #1
    coolwhisper is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2013
    Posts
    10

    Unhappy How to use Where condition in Macro Access 2010 for two fields

    Dear All,



    I need to make a filter by using Macro in Access 2010

    To do this I need to use two fields to get the result.

    So in "Where Condition" I should put an expression belong to the poth of the fields.

    I now how to use "Where condition" but only for one field like below :



    Code:
    ="[TabReq_No]=" & [Text2]

    Can you help me please ?

    Kind regards & many thanks

  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,521
    Along the lines of:

    ="[TabReq_No]=" & [Text2] & " And [OtherFieldName] = " & [SecondTextbox]
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    coolwhisper is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2013
    Posts
    10
    Many thaks pbaldy
    This great and it works

    have a good day

  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,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    coolwhisper is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2013
    Posts
    10
    Dear pbaldy

    I got a problem again with this :


    IsNull([CText2] And [CSecondTextbox])

    It's for two Texts but doesn't work with me !!

  6. #6
    coolwhisper is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2013
    Posts
    10
    IsNull([Text2] And [SecondTextbox])

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Test each separately with IsNull, not together.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    coolwhisper is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2013
    Posts
    10
    sorry it works with me now

    IsNull([Text2]) And IsNull([SecondTextbox])

    Good

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

Similar Threads

  1. Using Condition in Stop Macro
    By MikeWaring in forum Programming
    Replies: 2
    Last Post: 11-01-2012, 03:00 PM
  2. Access 2010 Macro Help
    By RayMilhon in forum Access
    Replies: 3
    Last Post: 09-30-2011, 12:03 PM
  3. Access 2010 Macro
    By RayMilhon in forum Access
    Replies: 3
    Last Post: 09-28-2011, 11:37 AM
  4. where condition within a macro
    By kstyles in forum Reports
    Replies: 3
    Last Post: 04-08-2011, 03:58 PM
  5. Macro Condition
    By eww in forum Programming
    Replies: 5
    Last Post: 08-27-2010, 10:59 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