Results 1 to 4 of 4
  1. #1
    elbartje is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    23

    Change query with VBA

    Hi all



    I want to add a filter to my query the value has to come from a combobox of a form.
    It can be done like this: =[Forms]![frmFORM1]![cmbFILTER].[Value]
    This works.

    But now I want to add wildcards and then the querry does not work.
    Filter: like '*[Forms]![frmFORM1]![frmFORM1].[Value]*'

    I think access just does not allow this ?
    Is there an other fix ?

    Can I do it with VBA like how you change the recordset from a form -> (...recordset = SQL)
    But how do I refer to a specific query in my database.

  2. #2
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349
    like '*' & [Forms]![frmFORM1]![cmbFILTER].[Value] & '*'

  3. #3
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Your syntax is a little off. Separate the wildcard asterisks from your Form value with ampersands.
    See: https://www.techonthenet.com/access/...parameter3.php
    or
    https://www.access-programmers.co.uk...d.php?t=210002


    Edit: A little slow on the reply while looking for links!

  4. #4
    elbartje is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    23
    Thank you !

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

Similar Threads

  1. Replies: 6
    Last Post: 04-22-2015, 03:15 PM
  2. Replies: 6
    Last Post: 12-03-2014, 10:28 PM
  3. Change ID to Name in Query
    By Rabastan99 in forum Queries
    Replies: 7
    Last Post: 10-21-2014, 07:46 PM
  4. Replies: 2
    Last Post: 10-03-2014, 10:07 AM
  5. Replies: 3
    Last Post: 07-20-2012, 11:41 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