Results 1 to 5 of 5
  1. #1
    Grooz13 is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    97

    Red face DoCmd OpenReport ... where condition with a Like

    Code:
     
    DoCmd.OpenReport "R_Client_Job", acViewReport, , "Job_Name Like *" & Txt_KeyWord & "*"

    this is my code and I always get error 3075 missing operator or something and it's bothering me... I did this with a macro but now I need to do it with vb since the macro can't do as much some code can ...



    sorry for my bad english

    Thx

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    DoCmd.OpenReport "R_Client_Job", acViewReport, , "Job_Name Like " & "*" & Txt_KeyWord & "*"

  3. #3
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    DoCmd.OpenReport "R_Client_Job", acViewReport, , "Job_Name Like '*" & Txt_KeyWord & "*'"

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by weekend00 View Post
    DoCmd.OpenReport "R_Client_Job", acViewReport, , "Job_Name Like '*" & Txt_KeyWord & "*'"
    this was tested and worked:

    Code:
    DoCmd.OpenReport "R_Client_Job", acViewReport, , _ 
    "Job_Name Like " & """" & "*" & Txt_KeyWord & "*" & """"

  5. #5
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Sure it works.

    But mine is neater than yours (i am joking)

    Yours can be simplified to:

    DoCmd.OpenReport "R_Client_Job", acViewReport, , _
    "Job_Name Like ""*" & Txt_KeyWord & "*"""

    then it is almost same as mine, just use double ("") instead of (')

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

Similar Threads

  1. Replies: 7
    Last Post: 12-10-2018, 05:24 PM
  2. OpenReport function
    By grad2009 in forum Access
    Replies: 8
    Last Post: 05-22-2010, 10:43 AM
  3. OpenReport Command with Double Check Where Statement
    By Robert M in forum Programming
    Replies: 3
    Last Post: 09-17-2009, 04:01 PM
  4. Can docmd.openreport print X copies on Y printer?
    By Coolpapabell in forum Reports
    Replies: 1
    Last Post: 09-02-2009, 08:35 AM
  5. Can I pass "sort by" using DoCmd.OpenReport
    By alsoto in forum Reports
    Replies: 3
    Last Post: 04-16-2009, 08:11 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