Page 1 of 3 123 LastLast
Results 1 to 15 of 35
  1. #1
    Frankie is offline Novice
    Windows 11 Office 365
    Join Date
    Sep 2023
    Posts
    18

    Report showing numbers instead of text...

    I know this has been posted before, and I have read them, but am still trying to figure this out.



    So, I have a database. I enter in cost information for a home I purchased to rent. I have created some list tables that I can use for combo box data entry to keep data uniform. I have a separate list tables for each: Property, Company, Resource, and Payment Type. When I enter these into table (from form combo box), it works perfectly. Table is populated with text precisely as I wish it to.

    I then have a form to search my records which is based off of a query. I can enter a Property, Company, Resource, Payment Type (which are all unbound combo boxes on form, they reference the list tables) or I can enter a date range, which is a standard unbound date format box. The query uses the unbounded fields from the form in its criteria to retrieve data and populate the query itself. This works wonderfully! I can open the query and everything works like a charm.

    Now that you know what works... here is the hick-up. I now decide to create and run a report (for tax purposes) off of the query mentioned above that runs so beautifully on its own. The report populates any field that originated from combo box (list table) as a number, and not the text that appears in the query. For example, the Property might be listed on the form combo box as "59 Main St" and it appears this way on the query as well. However, on the report, in the Property box, it shows a "1" instead of "59 Main St". Perhaps because it is the first item listed in the combo box/list table? I'm guessing here.

    I read that I need to add/join any list tables to the query besides the main table it draws from, and use those fields, but when I did that, I got a "type mismatch"? I have no idea where that even came from, nor how to fix it. The query and report wouldn't even run. So I removed the list tables off of the query again, as it was previously, and the queries run beautifully, but still no dice on reports. Maybe I've done something wrong? (obviously).

    Any help would be appreciated.
    Frankie

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    difficult to provide help without any real substance. My guess would be you are using lookups in your table design which can produce this sort of error. If that is the case, remove the lookups, then you can see what you actually have.

  3. #3
    orange's Avatar
    orange is online now Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Are you using lookup fields in your table(s)?
    You may find useful info from this material from Isladogs (Colin).
    There are many articles in my signature link Database Planning and Design also.

  4. #4
    Frankie is offline Novice
    Windows 11 Office 365
    Join Date
    Sep 2023
    Posts
    18
    What is a lookup? I have basic knowledge: tables, queries, forms, macros... I have form fields that refer to tables for combo boxes (they look up data in those tables), is that what you mean by lookup? If I need to send copy of database or send/post screen shots i def will. this is bothering me and I'm the type of individual who gets little rest until I figure things out, lol.

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    is that what you mean by lookup?
    No. Lookup tables are fine - they just produce records/lists for listboxes and combo boxes mostly. The autonumber pk of the lookup table would be what you store in the table with the records you're building. The query uses the lookup table autonumber pk which is joined to the main table on the field that holds that number. The lookup table is where you get the descriptive text from that relates to that autonumber field.

    Lookup fields in tables is what is "bad" according to many db developers. If you click in a table field and a combo appears, you have a lookup field. Not that you should be editing directly in tables anyway.

    To post a db, copy it, compact/repair and zip it. See "How to attach files" at the top of the forum page.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Your "list tables" are lookup tables. You have set up lookup fields in tables and apparently set up to save autonumber ID but display text - aka alias data display. Since you already have them, might as well leave, just need to understand how they work. If you use a combobox on report then you would see the alias data displayed and combobox will look and act like a textbox in PrintPreview or direct to printer. Otherwise, need to build a query that joins tables to retrieve related info and use that as report's RecordSource.

    If you get datatype mismatch when trying to join tables, sounds like the primary and foreign key fields are not compatible data types. If primary key field is autonumber then the related foreign key field must be Long Integer, not Text. Possibly just need to change the foreign key field data type in table design.

    How did you create the lookup field? Did you use the lookup wizard? Changing a lookup field that was created with the lookup field wizard is not simple. However, the wizard should have handled the data types and then should not have mismatch issue.

    Why are you using UNBOUND form and controls for data entry?
    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.

  7. #7
    Frankie is offline Novice
    Windows 11 Office 365
    Join Date
    Sep 2023
    Posts
    18

    Compact, Repair, Zipped DB

    Here it is. You will see the relationships I have between 4 list tables and main table. I do have the data entry form connected to table for data entry. Maybe that needs to change as you say?? Suggestions welcome.

    Query is based on FormBillsQuerySearch, then report is based on query. And the report is the only thing I am having issues with.

    thanks, I appreciate it.
    Attached Files Attached Files

  8. #8
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    If you click in a table field and a combo appears, you have a lookup field
    Did you do this? Your table fields are lookups. That's why your report shows the numbers. Queries and tables handle the hidden values (the text you seek) - reports don't. So, what June7 said.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    If you can make sense of this you might be able to fix your issue.

    Here's an example of its application - just to get the Companies related to table properties autonumber 1:
    Code:
    SELECT [Bills Expenses].ID, [Bills Expenses].Property, [Bills Expenses].Company, 
    [List Properties].ID
    FROM 
    [List Properties] INNER JOIN [Bills Expenses] ON 
    [List Properties].ID = [Bills Expenses].Property
    WHERE (((
    [List Properties].[Property Address])="321 Main Street"));
    321 Main Street would come from your form.

    Instead of using your list table autonumbers as foreign keys in your billing table, you've made them lookups from the list tables. Might as well not bother with the autonumber fields. Not what you want anyone to say I imagine, but in the long run you'd be better off starting over and doing it right. If you do, adopt a better and more consistent naming convention.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Frankie, did you read post 6? Fixing report is simple. As I described, either use comboboxes on report or since you have query as report RecordSource, include fields from the lookup tables in query grid and bind textboxes to those field. As is, you have the tables in query but don't pull in the fields.

    Might want to explore technique of cascading comboboxes for the search form.

    I don't use parameterized queries. I prefer to apply filter to form or report. 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.

  11. #11
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    Hi Frankie
    When you run your Report does the Report Flicker continuously?
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  12. #12
    Frankie is offline Novice
    Windows 11 Office 365
    Join Date
    Sep 2023
    Posts
    18
    unbound field aren't for data entry, they are on form and used as criteria for query.

  13. #13
    Frankie is offline Novice
    Windows 11 Office 365
    Join Date
    Sep 2023
    Posts
    18
    no... just shows the ID (key) instead of text for my Property, Company, Resource, and Payment Type (which are all entered into original tables by combo box)

  14. #14
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by Frankie View Post
    no... just shows the ID (key) instead of text for my Property, Company, Resource, and Payment Type (which are all entered into original tables by combo box)
    But hey are table lookups , which hide their true value, which is the ID NOT the lookup value.

    If you do not wan to do the job properly, just create a query that brings in those text fields and use those instead in your report.

    http://access.mvps.org/access/lookupfields.htm
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  15. #15
    Frankie is offline Novice
    Windows 11 Office 365
    Join Date
    Sep 2023
    Posts
    18
    The unbound form is criteria for query search, not for table entry.

Page 1 of 3 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 08-13-2015, 05:16 PM
  2. Number showing instead of text on a report.
    By GCtechjim in forum Queries
    Replies: 6
    Last Post: 01-10-2015, 08:14 PM
  3. Replies: 2
    Last Post: 06-19-2013, 06:13 AM
  4. Replies: 9
    Last Post: 10-21-2011, 08:38 AM
  5. Replies: 2
    Last Post: 04-29-2009, 11:50 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