Results 1 to 2 of 2

Invalid Use Of Null

  1. #1
    johndoe123 is offline Novice
    Windows 10 Access 2007
    Join Date
    May 2019
    Posts
    2

    Invalid Use Of Null

    I have the following codes for my data from the table Stock_Master



    Stock_Master table has
    Product_ID = Number
    Category = Text
    Type = Text
    Size = Text
    Total_Quantity = Number
    Min_Req = Number

    And this is my coding for a button that is aimed to open a report based on the search criteria I have done.


    StrText = Me.StockMasterSearch
    strsearch = "select * from Stock_Master where ((Product_ID like " & StrText & "))"


    DoCmd.OpenReport "Customer_Search_Report", acViewPreview, strsearch


    However, I received an

    Run-Time Error '94'
    Invalid Use Of Null.

    What is wrong??

  2. #2
    JoeM is online now VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,711
    The Filter name argument of OpenReport only has the WHERE clause of the SQL code (without the word WHERE).
    You have a whole Query statement.
    See: http://codevba.com/msaccess/docmd_op...m#.XNmrtflKipo
    Using Access 2007
    Proficient in Access, Excel, VBA, and SQL

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

Similar Threads

  1. Replies: 4
    Last Post: 04-09-2019, 02:05 PM
  2. Invalid Use of Null
    By Lou_Reed in forum Access
    Replies: 9
    Last Post: 03-30-2017, 07:43 AM
  3. Invalid use of null?
    By snipe in forum Programming
    Replies: 12
    Last Post: 05-12-2015, 04:53 PM
  4. Replies: 3
    Last Post: 11-13-2013, 08:56 AM
  5. Invalid use of Null
    By justauser in forum Forms
    Replies: 2
    Last Post: 11-28-2012, 12:33 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
  •  
Tech Forums: Microsoft Office Forums