Results 1 to 6 of 6
  1. #1
    numnum4me is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    3

    Field in Report shows entered criteria from [field] criteria in query


    Dear all,

    I made a query with several fields, one of them is product name, and has as criteria "*"& [productname] & "*". This means when I open the query, it asks me for a part of the product name I wish to look up for in the database. All goes well until this point.
    Now when I create a report based on this query, I don't get the full product name displayed, but only the "part" I put in to do the search.

    Is there a way I can show the full product name in the report instead of the "part"I filled in to search for the product?

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    If you have a textbox bound to the field [productname] then that is what should be showing in the report. I don't know why the report shows the criteria. Post the report RecordSource SQL statement.
    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
    numnum4me is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    3
    Hereunder i pasted the SQL text from the query:

    PARAMETERS [Productnaam] LongText;
    SELECT Analyses.[Datum Productie], Analyses.[P-Nummer], Analyses.Batchnummer, Analyses.[Naam Uitvoerder], Analyses.Productnaam
    FROM Analyses
    WHERE (((Analyses.Productnaam) Like [Productnaam] & "*"));

    and yes, as stated above, I SHOULD get the full name or names of the searched products in the rapport, but I only get the letters I typed in in the query search.
    This is so weird and I don't understand why I get the results displayed as my own search quote.

    When I make the same rapport and query but instead searching on name, searching on date or product number, it works flawlessly.

    Thanks

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    What happens if you use Text rather than LongText? Just a guess, since I'm not sure why a Product name would need a LongText field.
    I would also suggest you name the parameter differently than the fieldname eg. p_productnaam or similar.

  5. #5
    numnum4me is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    3
    Changing the long text to short text doesn't solve the problem.

    Oh but changing the parameter different from the field name in the query did solve the problem.

    Thanks for all the help, this thread may be closed

    Sincerely

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    I have never used the PARAMETERS clause and I never use dynamic parameterized queries. I use code (VBA is my preference but macros can work) to apply filter to form or report and reference inputs on form for criteria. Can validate user input with controls on form. Review: http://allenbrowne.com/ser-62.html
    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: 2
    Last Post: 05-17-2017, 06:17 AM
  2. Replies: 2
    Last Post: 09-11-2015, 12:42 PM
  3. Replies: 4
    Last Post: 08-30-2014, 10:23 AM
  4. Replies: 2
    Last Post: 10-19-2012, 01:44 AM
  5. Change field criteria in a report, or query
    By mdnikki in forum Reports
    Replies: 3
    Last Post: 10-05-2012, 12:43 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