populate subform based on combobox

DT

Registered User.
Local time
Today, 07:23
Joined
Oct 23, 2000
Messages
83
I'm having a rough time lately. It's been awhile since I have used Access and I can't get my brain back into it.

Is it possible to show all records in a query (4 different queries) on a subform based on a combobox on the main form?

So if combobox was "ONE" subform would show all records for "qryOne"

DT
 
Yes, just set the subform recordsource to take records from the appropriate query from the After Update event of the combo box.

Use some code like this:
Code:
Me.ComboBox_AfterUpdate()
    Me.subform.RecordSource= "qry" & Me.ComboBox
End Sub
 
thanks for your help...again!

i'm getting a Compile error:

Method or data member not found

any ideas?
 
Last edited:
Hi

You don't say what the queries are or how big but why not combine them and use a combobox to run the query based on different search criteri? that way you can enter what you are looking 4 and display the results.

I do this but display the results in a list box and then pick from the list for the full details.

My contacts db is holding some 3000 + records and each of those records is cappable of displaying over 200 different pieces of info but this method is super fast (like milli secs), very efficient and I don't need loads of different queries.

regards
 
DT, I was just giving an example. Make sure you substitute the name of your own subform in the code.
 
dcx693,

<<I was just giving an example. Make sure you substitute the name of your own subform in the code.>>


I know...That's why I can't figure out why I'm getting the error. I have tried an unbound combo a bound combo. There must be something in my subform.

Thanks for your help...I'll keep digging.
 
Durn it. My bad. The correct syntax is:

Me.subform.Form.Recordsource="queryname"
 
You're welcome. Sorry I didn't get the syntax right at first.
 

Users who are viewing this thread

Back
Top Bottom