Results 1 to 9 of 9
  1. #1
    tirfan is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    14

    Creat Query and use Multiselect list as Criteria of Query

    Dear Expert i have already Post one question but i did not get any answer up to now. if any one want to check then please click on below link
    https://www.accessforums.net/queries...ria-27861.html



    now my question is more clear for the expert. because i will attach the files which can help the experts to analyze the problem. kindly help me where i am making mistake. Many Thanks in advance.
    Attached Thumbnails Attached Thumbnails Message Box StrCriteria.JPG   Message Box StrSql.jpg   Error Message.JPG  

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I tried the attachment in the other thread and I do not get those errors. The first 2 errors indicate you're not concatenating strCriteria into the string properly. You are in the database attached.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    tirfan is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    14
    sir First two message are actuallay not error message. 1 message is StrSql. second Message with Microsoft office Heading is STRCriteria but only Third Message is Error Message where Visual Basic Gives Error. but i Attach Strcriteria, Strsql and Error messgae for the Expert to understand. that where is problem. becuase it seems to me. that Strcriteria In('East','West') is ok. Second StrSql have some where problem. i think this will give you more clear understanding.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Whether they are errors or not, the SQL displayed is not valid and indicates a concatenation error. Again, a brief test of your sample did not cause an error. Either provide a sample that does, or indicate the specific steps necessary to reproduce the problem.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    tirfan is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    14
    Dear sir,

    Please find attach the file and kindly help me to solve the problem. This is very important to me.

    waiting for your kind response.
    Attached Files Attached Files

  6. #6
    tirfan is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    14
    sir, i have attached the file for your review and easy refrence.

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    If you had ever posted the code it would have been obvious. You missed the "AND" between the criteria:

    Code:
      strSQl = "SELECT tbldata.* FROM tbldata " & _
               "WHERE tbldata.[Region] " & strCriteria & _
             " AND tbldata.[EmployeesName] " & StrCriteria1
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    tirfan is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    14
    Thank you very much . your reply solve my very big problem. thank you once again

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. need help to creat a Query for Futre date?
    By YaseenIskaf in forum Queries
    Replies: 7
    Last Post: 08-21-2012, 10:57 PM
  2. Replies: 5
    Last Post: 08-02-2012, 09:44 AM
  3. Query Criteria Function and Operator List?
    By samanthaM in forum Access
    Replies: 2
    Last Post: 06-03-2012, 04:52 PM
  4. Multi-Select List Box as Criteria in Query
    By broadwat in forum Queries
    Replies: 6
    Last Post: 09-19-2011, 07:47 AM
  5. Replies: 6
    Last Post: 06-29-2010, 09:56 PM

Tags for this Thread

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