Results 1 to 4 of 4
  1. #1
    wazimu13 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2014
    Posts
    4

    Unhappy Filtering records on multiple items web form not working :(

    Hi



    Im quite new to Access and trying to enable database users to filter records based on
    column names which i have in a combobox. They enter the required value in a textbox and click the "Find"
    button.

    The code is not throwing any errors but the records are not being filtered , which is very frustrating. Perhaps
    someone can point out what im missing.

    PS: this is a web database. All help is appreciated.

    thanks

    Click image for larger version. 

Name:	x2014-11-26_22-30-10.jpg 
Views:	14 
Size:	34.1 KB 
ID:	18872

    Click image for larger version. 

Name:	zz2014-11-26_22-32-46.jpg 
Views:	14 
Size:	16.8 KB 
ID:	18873

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Yuk - web and macros! The concatenation would be so easy in VBA. What you have actually looks okay, just more concatenation than needed, but should still work.

    "[" & [Forms]![CustomerDS1]![cboCols] & "] LIKE '*" & [Forms]![CustomerDS1]![txtFind] & "*'"

    Are you sure value of cboCols is the exact spelling of field name? Are all the fields text data type?

    What is the RowSource?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    wazimu13 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2014
    Posts
    4
    hi

    Thanks for your reply. Yes the fields are all text, and i know on the screenshot i have "LastName" and "Last Name"
    as field name and dropdown option. I have tried both with the same result. The fieldname on the customers table where the data is from, is "LastName"

    On clicking find, the screen just flashes and no filtering occurs.

    I tried using less concatenation (omitting the [Forms]![CustomerDS1]! bit) but access doesnt seem to like this and i got the following
    error. So the code i tried was:

    "[" & [cboCols] & "] Like " & "'" & "*" & [txtFind] & "*" & "'"


    ( "You either have an error in your explression of you have attempted to use an undeclared parameter" - check the expression for errors or enter the parameter '[cboCols]' in the query parameters dialog)

    any ideas?

    thanks

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    That wasn't the reduced concatenation I meant.

    Did not show the RowSource of combobox as requested in previous post.

    If you want to provide db, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 9
    Last Post: 04-26-2014, 07:10 PM
  2. Replies: 10
    Last Post: 07-23-2013, 05:07 PM
  3. Replies: 5
    Last Post: 03-12-2012, 02:58 AM
  4. Replies: 18
    Last Post: 01-27-2012, 12:53 PM
  5. Replies: 2
    Last Post: 07-10-2011, 07:22 PM

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