Results 1 to 4 of 4

Thread: Filtering Macro question?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Location
    Grand Junction, CO
    Posts
    67

    Filtering Macro question?

    If I have column headings named
    Wire
    Walker Conn #
    Base Sensor

    Only the first DoCmd works ("wire =wires")

    I get an error on the other two.
    I have tried different syntax and have not been able to get it to work.



    VB Code:
    1. Public Sub SampleSearch()
    2.  
    3. DoCmd.ShowAllRecords
    4.  
    5. DoCmd.ApplyFilter , "wire = wires"
    6.  
    7. DoCmd.ApplyFilter , "Walker Conn #  = ConnNum"
    8.  
    9. DoCmd.ApplyFilter , "Base Sensor = BaseSensor"
    10.  
    11.  
    12. End Sub

  2. #2
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Filtering Macro question?

    DoCmd.ApplyFilter , "Walker Conn # = ConnNum"

    DoCmd.ApplyFilter , "Base Sensor = BaseSensor"
    I could be wrong but i guess it might be because of the space between the words...
    Try changing the column headings to Walker_Conn_# and Base_Sensor...
    Hope it helps...
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Location
    Grand Junction, CO
    Posts
    67

    Re: Filtering Macro question?

    I tried this and still only the first one works([wires] = wire)?

    VB Code:
    1. Public Sub SampleSearch()
    2.  
    3. DoCmd.ShowAllRecords
    4.  
    5. DoCmd.ApplyFilter , "[wires] = wire"
    6.  
    7. DoCmd.ApplyFilter , "[WalkerConnNum] =  Connnum"
    8.  
    9. DoCmd.ApplyFilter , "[BaseSensor] = BaseSensor"
    10.  
    11. PrgramEnd:
    12. End Sub

    I renamed my columns to match
    wires
    WalkerConnNum
    BaseSensor

    Morgan

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Location
    Grand Junction, CO
    Posts
    67

    Re: Filtering Macro question?

    and i cannot find this command listed in help??


    DoCmd.ApplyFilter



    any ideas??
    Morgan

Posting Permissions

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



Click Here to Expand Forum to Full Width