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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run a report after choosing value from combo box

Status
Not open for further replies.

WB786

MIS
Mar 14, 2002
610
I have seen many posts here and I tried to use them with my situation and it is not working. Can someone please help me. On my form I have a combo box called counselors that list all of the employees. I have already made a query to point to this combo box and built a report based on the query. But when I select an employee name. Nothing happens. I want it to run the Report. What am I doing wrong? Thanks in advance.
 
Not sure exactly what you have so far but I think maybe in the change event for the combo box you need to open your report, eg:

Private Sub Combo1_Change()

DoCmd.OpenReport "myReport", acPreview

End Sub Best Regards,
Mike
 
Cool that worked. But the report came up blank. Looks like it didn't pass any values to the query or my query might not be setup right. Any ideas? Thanks.
 
Well, in your query you can refer to the currently selected value in the combo box or you could bind the combo box to a (temp) table and join to this in your query to get the appropriate data. Best Regards,
Mike
 
This is how I am selecting my query value. I am choosing employee from the table and dropping it into my query. Then for criteria I right click and choose build and then go down to loaded form (it comes up blank) so I go to all forms and then chose the combo box from the middle row and click on ok to close my build box. Is that correct? If this is correct then somewhere the value is not getting transfered over from combo box. Anything else I need to look for? Thanks.
 
Ok I got it to work. The bound column was set to 1 and the name was on 2. So all is good now. Thanks you very much for your help!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top