Results 1 to 4 of 4

Trying to filter on edit box

  1. #1
    xcheshire.cat is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Oct 2019
    Posts
    2

    Trying to filter on edit box

    Hi,

    I have a search box named SearchFieldEditBox in my form

    I'm trying to refer it in thefilter property :

    [FirstName] Like "*" & [UsersWithMainEmail]![SearchFieldEditBox] & "*"

    or
    [FirstName] Like "*" & [SearchFieldEditBox] & "*"




    It keeps on asking me to enter it manually. How can I refer correctly tomy field ?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    7,665
    save the brackets for queries, or textboxes with spaces.

    if the text box name is
    SearchFieldEditBox, then
    for a form filter:

    Me.filter = "[FirstName] Like '*" & me.SearchFieldEditBox & "*'"
    me.filterOn = true


    else for a query:
    where
    [FirstName] Like "*" & forms![UsersWithMainEmail]![SearchFieldEditBox] & "*"

  3. #3
    xcheshire.cat is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Oct 2019
    Posts
    2
    It is still asking me for it. I am not doing it programatically, but in the designer properties tab, Is it changing something ?

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    6,206
    It is still asking me for it
    This means you are getting a parameter prompt? I would ordinarily say you have a spelling issue or some other reference problem, but what's the point of specifying the filter in the form's property sheet? Are you going to apply the filter automatically on form load? I'd say no because there would be no value in the textbox. However, from the property sheet there is no other option.
    - "doesn't work" is no help. Post err msgs and where.
    - Use code tags for code/sql. Implement changes in copies of your database.

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

Similar Threads

  1. Form filter and add/edit
    By slimjen in forum Forms
    Replies: 12
    Last Post: 08-09-2019, 09:08 AM
  2. Replies: 2
    Last Post: 02-20-2017, 11:28 PM
  3. Replies: 0
    Last Post: 03-18-2016, 09:13 PM
  4. Replies: 9
    Last Post: 02-24-2015, 11:19 AM
  5. Replies: 1
    Last Post: 05-31-2013, 08:53 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
  •  
Tech Forums: Microsoft Office Forums