Results 1 to 3 of 3
  1. #1
    BorisGomel is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    101

    Filter query off form

    Hi everybody,
    I am trying to filter a query off a form and I am stuck here. I have a very large table named AllBanks2012 and I made a cross query named InquireAllBanks2012. I created a new form named InquireForm with 4 text boxes on it:txtDate,txtName,txtFile and txtPostDate. In design veiw of the query InquireAllBanks2012 in criteria field , I typed following Like[Forms]![InquireForm].[txtDate]&"*", Like[Forms]![InquireForm].[txtName]&"*",and so on accordingly the fileds on the query I would like to filter . I set commad button "Run Query" on form with code DoCmd.OpenQuery "InquireAllBanks2012", acNormal in event one click . So if an user wants to filter query based on these four fields , he types parameters in text boxes and than click "Run Query" .The problem trhat it returnes no data, but there are datas . I typed dates and I know that table contains data for these dates , but the quiery returned no data. Might be Like[Forms]![InquireForm].[txtDate]&"*" something wrong here. I tried Like[Forms]![InquireForm]![txtDate]&"*" , but it still the query returned no data.

    Help will be greatly appreciated.

    Thnak you in advance for help,

    BorisGomel

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,972
    Are these fields allowed to have Null? If so, the Like criteria won't work. Need to handle the nulls. Create fields in query with expressions, like:

    Nz(fieldname,"")

    Then put the Like parameters under these constructed fields.
    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
    BorisGomel is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    101
    Thank you June 7. I did as you told me and now it woks. Thank you very much.

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

Similar Threads

  1. Replies: 5
    Last Post: 04-11-2012, 06:52 PM
  2. Replies: 28
    Last Post: 03-08-2012, 06:47 PM
  3. Replies: 1
    Last Post: 03-05-2012, 07:35 PM
  4. Pass a Form Filter to a Query
    By kenton.l.sparks@gmail.com in forum Programming
    Replies: 4
    Last Post: 04-01-2011, 11:48 AM
  5. Form Based Query/Filter
    By Micon in forum Access
    Replies: 0
    Last Post: 11-07-2008, 09:25 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