Emailing a single report part 2

Crash1hd

Registered CyberGeek
Local time
Yesterday, 21:18
Joined
Jan 11, 2004
Messages
143
So I have created a query to email a single report based on the data I have open in the form! problem is that when I click on the button to email the report it ask me what the Inbound_ID is I want that to be carried over for me how would I go about doing that????

Ok so here is my query!

SELECT Employees_Inbound_Query.Initials, Employees_Inbound_Query.Emp_First_Name, Employees_Inbound_Query.Emp_Last_Name, Employees_Inbound_Query.Inbound_ID, FROM Employees_Inbound_Query LEFT JOIN Employees_Soft_Skills_Inbound_Query ON Employees_Inbound_Query.Inbound_ID = Employees_Soft_Skills_Inbound_Query.Inbound_ID
WHERE ((([Employees_Inbound_Query.Inbound_ID])=[ME]![Inbound_ID]));

and here is my code

Private Sub Email_Inbound_Report_Click()
On Error GoTo Err_Email_Inbound_Report_Click

Dim stDocName As String

stDocName = "Email_Inbound_Report"

DoCmd.SendObject acReport, stDocName

Exit_Email_Inbound_Report_Click:
Exit Sub

Err_Email_Inbound_Report_Click:
MsgBox Err.Description
Resume Exit_Email_Inbound_Report_Click

End Sub

what ddo I need to change so that it doesnt ask me which inbound_ID everytime??
 
C'1HD,

There may be more to fix but this jumped right out at me...

A fragment of yours...
Code:
WHERE ((([Employees_Inbound_Query.Inbound_ID])=[ME]![Inbound_ID]))

should be...
Code:
WHERE ((([Employees_Inbound_Query.Inbound_ID])=Forms!YourFormName![Inbound_ID]))

Regards,
Tim
 
Ahh I see the error of my ways! :rolleyes:

Thankyou:D
 

Users who are viewing this thread

Back
Top Bottom