Show data in listbox, what am i missing?

behedwin

Active Member
Joined
Dec 10, 2014
Messages
399
Hi

I have tried over and over to get my data to show in a listbox when i pick a record in another listbox.

I have two tables. One with staff information and one with dates etc.
Then i have a form where i have a listbox displaying the names. If i press a name the rest of the staff data is displayed in different fields.
At the bottom i have a listbox where i want to open the second tables data when i select a staff member.

But i can not get it to work...

Hope someone have time to look at my file and see what i am missing.

Here is the file in a zip: https://ufile.io/cbb82
Or here as just the access file: https://ufile.io/bc18z
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
To begin with when you say you have a "Form" do you mean a "UserForm"

And what does this mean?
At the bottom i have a listbox where i want to open the second tables data when i select a staff member.
How do you "Open" the seconds Tables data??

Do not understand Open Data
 
Upvote 0
Sorry. I see now this is a Ms Access question.
To begin with when you say you have a "Form" do you mean a "UserForm"

And what does this mean?
At the bottom i have a listbox where i want to open the second tables data when i select a staff member.
How do you "Open" the seconds Tables data??

Do not understand Open Data
 
Upvote 0
You need to make the "Log" a separate form bound to the second table. Insert the second form into the first form as a sub-form and create a parent-child relationship between the two forms.

https://www.youtube.com/watch?v=NQm_fNSwk9o

i know about this.
But this is not what i want... the subform does not display as i want and have not the right feeling.

id like to populate the listbox with a query based on the displayed record.
 
Upvote 0
Still struggling to understand what my file is missing.
been googling and playing around with things over and over the whole day.
but can not find any solution

uploaded a new file here:
https://ufile.io/7bdlz
 
Upvote 0
I think that I solved it for you.

The file has been uploaded to Box.net https://app.box.com/s/jq8c7isvt9pgcarmhxk0r46lszze539d

If you examine the file you will see that you were trying to link to the wrong field and additionally, you needed a requery based upon the first combo box being updated.

Alan

Yees, i got it to work! Thanks!

I have a question tho.

Could you with text explain the process that access is doing here:
In the listbox for the log data where i want to show the log_table data
you added the criteria
Code:
[Forms]![Profile_Form]![txtProfile_ID]
to the log_id
but what does that mean? What am i doing here... why should this criteria be under the log_id and not the profile_id_sk?

And then you added a line of code
Code:
Me.Log_Listbox.Requery
what does that line mean?

what does this line mean
Code:
Me.Requery
 
Upvote 0
1. Need to use the key that links to the table that identifies the record --relationships.
2. Requery does exactly that. It requeries and refreshes the query for the particular control otherwise the already populated control will not return the correct data.
3. See 2 above.


While this video link is not directly about what you are doing, some of the things you wish to do are clearly covered here. Take a few minutes to watch this. I think it will be enlightening.

http://www.datapigtechnologies.com/flashfiles/buildcustomfilter.html
 
Upvote 0

Forum statistics

Threads
1,221,657
Messages
6,161,084
Members
451,684
Latest member
smllchng5

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top