Results 1 to 4 of 4
  1. #1
    johanvonh is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2015
    Posts
    2

    Angry Hopefully a simple problem with my report output

    Some background:


    Working on an access database in which data entry people would select a subcategory from a combobox which was being populated from a table containing 2 fields, ID and Category. During the course of using the database, it came up that the people populating the Category field needed to store more than 256 bytes, so the decision was made to switch the Category field type to Memo. Of course Access limits the output in a combobox to 256 bytes, but this was sufficient for data entry people to select the correct item, which then stored the correct record pointer in the main table.

    Now that data entry is complete, the issue is arising now (as all of the queries and reports were generated before switching Category to a Memo field) that the reports are only outputting the first 256 characters, obviously problematic for output of the several dozens of items which have more than that.

    Things I've experimented with as solutions:
    In the original data entry form, I created a textbox next to the combobox with its controlsource set to the following dlookup():
    =DLookUp("[Category]","tSubcategory","ID = [SelectedCategory]")
    And it works correctly, outputting the entire text of the Category Memo field.

    In one of the reports I need to modify, which is generated from a query selecting a subset of the main table, I tried replacing the combobox output (access builds it with an INNER JOIN SQL query, but truncates the output to 256 characters as a result) with a textbox with its controlsource set to the same dlookup() above. Confusingly, it returned blank output. If I manually define the record to lookup, such as:
    =DLookUp("[Category]","tSubcategory","ID = 73"), then it resolves and outputs correctly in the report, including the full Memo text. I put a debug text box nearby with the value of [SelectedCategory] on the report, and it prints correctly. I'm at a loss why the dynamic dlookup() isn't evaluating correctly.

    I will gladly buy many beers for anyone who can help, and don't care how we achieve it. I Just need the report to correctly print out the complete related Memo field.

    Best regards,
    Johan

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Why are you using DLookup? Why not including tSubcategory in the report RecordSource so all related data is available?
    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
    johanvonh is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2015
    Posts
    2
    Quote Originally Posted by June7 View Post
    Why are you using DLookup? Why not including tSubcategory in the report RecordSource so all related data is available?
    As I indicated, any solution is fine. What is the best way to relate the fields once I add it to the RecordSource? I assume I'd be adding something like:
    SELECT ID, Category
    FROM tSubcategory

    How do I then accomplish the lookup between ID and SelectedCategory in the report? Can I do it directly with SQL? If so how do I reference it in the report?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    The report RecordSource would be a query that joins tables so all related data is available. Then bind a textbox to the Category field. The full text of the memo field should display.
    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: 4
    Last Post: 04-23-2014, 04:35 PM
  2. Replies: 4
    Last Post: 12-30-2013, 05:51 PM
  3. Output a report to pdf
    By TOMMY.MYERS668 in forum Programming
    Replies: 6
    Last Post: 02-25-2013, 09:00 PM
  4. .txt output from report
    By dhopper in forum Reports
    Replies: 1
    Last Post: 08-05-2011, 12:01 PM
  5. Output Report to Excel
    By BLD21 in forum Reports
    Replies: 5
    Last Post: 04-26-2011, 07:53 AM

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