Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Popupating a subform based on a combo box value

Status
Not open for further replies.

daleshei

Technical User
Mar 28, 2007
12
GB
I have a combo box, listing all the queries. Below that I have a subform (data sheet type) which I would like to populate using the query selected on the combo box.

Thanks

D
 
use the result of the combobox in the record sourrce of the subfor amd requiry

Ian Mayor (UK)
Program Error
9 times out of 10 I know what I'm talking about. This must be my tenth reply.
 
Thanks Program Error, any chance of you providing the VBA, I'm just struggling to get the concept :(

Form is called: frm_qry_slct

Combo box (Unbound): Combo23

RowSourceType: Table/Query
RowSoource:SELECT [Name] FROM MSysObjects WHERE [Type]=5 And [Name] Like "qry_#*" ORDER BY [Name];

Then my SubForm

I have a command button on the form just below the sub form to extract the query result into excel with the following code:

DoCmd.OpenQuery "Name of my query", acViewNormal
RunCommand acCmdOutputToExcel

I'm assuming the query result currently on the sub form is that one that will be extracted into excel or do I need to link it?

Thanks again.

D


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top