Results 1 to 4 of 4
  1. #1
    epardo87 is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    101

    issues with listbox display from query

    Hello All,

    So I have from frm22... with a listbox, when I select an option and click the "abrir" button, it opens up frm23... which has another listbox. this last listbox pulls data from a query filtered by the selection on the listbox of frm22.



    Now, the query used pulls data from a relationship table, which is created from another two tables

    The problem that I'm facing is the the listbox in frm23, instead of retrieving data as shown in the query (third column), it is showing the primary key, not of the query or the table used to create it, but the primary key of the original table (as you can see the numbers instead of names on the listbox of frm23) the filtering is done correct though, and the primary keys do correspond to the correct names, but I need to display the names... any suggestions?


    Click image for larger version. 

Name:	incorrect data.jpg 
Views:	15 
Size:	92.7 KB 
ID:	27018

    Click image for larger version. 

Name:	query called.jpg 
Views:	15 
Size:	114.2 KB 
ID:	27019
    Last edited by epardo87; 01-13-2017 at 05:51 PM. Reason: better explanation

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Looking at the query, you have 3 fields (columns).

    Open the form (frm23) in design view
    Select the list box.
    Open the properties window

    Try these property settings:
    "DATA" tab
    Bound Column = 1

    "FORMAT" tab
    Column count = 3
    Column widths = 0; 0 (set the 1st column width to 0" and set the 2nd column width to 0" )


    Save the form. Now open frm22, then frm23.

  3. #3
    epardo87 is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    101
    Quote Originally Posted by ssanfu View Post
    Looking at the query, you have 3 fields (columns).

    Open the form (frm23) in design view
    Select the list box.
    Open the properties window

    Try these property settings:
    "DATA" tab
    Bound Column = 1

    "FORMAT" tab
    Column count = 3
    Column widths = 0; 0 (set the 1st column width to 0" and set the 2nd column width to 0" )


    Save the form. Now open frm22, then frm23.
    Thanks Steve,

    I did what you suggested but now the listbox doesn't show anything... this is what I have in the Row source:

    SELECT [tbl-2-1-Designations Query].[Asignado] FROM [tbl-2-1-Designations Query];

    I'm guessing it might be something related to the fact that the query is pulled from a relational table... but can't figure it out

    look these are the relationships involved, the listbox is pulled from a query extracted from and with the exact same fields of the table "designations" I just need it in query to be able to filter it, but the numbers that the listbox is retrieving are the primary keys of the Operators table, those number don't even appear in the designation's table nor it's query...
    Click image for larger version. 

Name:	Untitled.jpg 
Views:	7 
Size:	61.5 KB 
ID:	27053
    I tried to pull data directly from the table instead of the Query and this is what happened, look at the wizard steps, i correctly selected the column required but instead of showing the names as seen on the table, it shows the primary keys of the original table (operators), which are not the primary keys of the table selected (designations):
    Click image for larger version. 

Name:	steps.jpg 
Views:	7 
Size:	172.4 KB 
ID:	27054
    I have been updating this post since I have been founding things, so when I looked at the lookups in the tables, I found that the designations table is calling for the number column first (the primary key) and then calls for the FullName column, I did the relationship through the lookup wizard, so it did that automatically, I erased the number lookup from the formula but then it just retrieved the primary keys, even though the formula was calling for the fullname column, I feel like I'm getting close, if you do know what is going on, I'd appreciate your advice, thanks
    Click image for larger version. 

Name:	relationship.jpg 
Views:	6 
Size:	101.9 KB 
ID:	27055
    Last edited by epardo87; 01-16-2017 at 11:45 AM.

  4. #4
    epardo87 is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    101
    So at the end, I just created a new column in the relationship table designations, used again the lookup wizard and linked it to only the FullName column, checked if the formula was referring for the Number column again, but this time wasn't, I just entered the desired values in the column again, updated the Query and everything worked well. It seems that I accidentally included the primary key column in the relationship table, along with the FullName column designations, don't remember doing that but doesn't matter now.

    Problem solved, thanks!

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

Similar Threads

  1. Cannot get Listbox to display records
    By edmscan in forum Queries
    Replies: 5
    Last Post: 07-22-2014, 12:54 PM
  2. Replies: 6
    Last Post: 08-01-2013, 12:31 PM
  3. Display RESULTS of Query into LISTBOX?
    By taimysho0 in forum Programming
    Replies: 6
    Last Post: 11-22-2011, 10:05 PM
  4. Replies: 2
    Last Post: 08-12-2011, 01:01 PM
  5. Currency/text display issues
    By Akazuba in forum Access
    Replies: 3
    Last Post: 04-20-2011, 07:51 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