Linking subform to listbox

badangel

Registered User.
Local time
Today, 00:55
Joined
Jan 31, 2003
Messages
26
Hi, I am having some problems getting my subform to display the info that I want it to. Any help would be greatfully recieved!

I have a list box on the left and a subform to the right which I want to display details of whatever is selected in the list box, however I am completely stumped as to how to go about this. I tried to get the list box details to open in a seperate form but I can't even get it to do that as it comes up with a form but the details inside it do not change.

Does anyone have any ideas??
 
In the subform's recordource, you need to reference the bound column (usually the first and PK) of the listbox in the criteria.

So, open the subform's recordsource and in the criteria of the relevant field (that matches the listbox), put...

[Forms]![FormName]![ListBoxName]

Change the above to your object names.
 
Sorry if i'm being thick but do you mean add that in the Source Object option for my subform? I tried that as it seems to be the only place to add it but then that obviously changes my subform completely.

Thanks (in advance)!
 
No, open your subform in design view.
In the form's property, select recordsource and click on the end '---' to open it in query view.

Add the above reference there.
 
I know where you mean now, thanks Kevin but I think what is confusing me is where do I state which attribute is being looked at in the List box as it contains 3 columns......or am am I way off here?!
 
The BOUND column.

If this is the first column then you simply reference the name of the listbox as I said before.
 

Users who are viewing this thread

Back
Top Bottom