open report based on combo selection/command button

fibayne

Registered User.
Local time
Today, 23:13
Joined
Feb 6, 2005
Messages
236
Hi

Im sure the answer to my question is here but I cant find a solution that works for me, what I would really like is when a command button is clicked that an enter criteria box opens where the user would enter the Manager name and the report would run detailing all clients belonging to that manager.
If this cant be done then by selecting the Manager from a combo box on the form by clicking the command button it would use the selection in the combo box to run the report ...once again thanks in advance for any help given...cheers Fi
 
Hi
I have found, and amended to fit my field names, the following code

Private Sub Command10_Click()
DoCmd.OpenReport "Debtors_Ageing", acViewPreview, , "[Manager]= '" & Me.cboManager & "'"
End Sub

This opens the report but doesnt display any data, could it be the query the report is based on that isn't correct, woudl I need to include tblManager in the query rather than using Manager from the tblClient where the manager name is stored ?? thanks again for any help...cheers Fi
 
Hi...I might answer my own question shortly :)

I created a text box and another command button the command button has the following code

Private Sub Command17_Click()
DoCmd.OpenReport "Debtors_Ageing", acViewPreview, , "[ManagerID]= '" & Me.txtManager & "'"
End Sub

this now works sopening the report and showing the relevant data, however it would be more user friendly for the Manager to select his/her name from a combo rather than typing in their name to produce the report ..is this possible ?? cheers Fi
 
Might be a bit cluncky but I have added to the after update event of cboManager to fill txtManager and made that not visible, the Command button then looks at txtManager and opens the report correctly, this seems to be working fine but if anyone can help me with something a bit smoother would be greatly appreciated...cheers Fi :)
 

Users who are viewing this thread

Back
Top Bottom