Filter and send mail

Aidanb

Registered User.
Local time
Today, 09:29
Joined
Sep 7, 2008
Messages
20
Hi All,

I am trying to send a filtered report with on record on it for takings and sickness i can filter through macro but cant get it to send the report by e-mail if it can be done through macro please let me know.

if not i want to do it through vba but am having problems in creating the filter i have looked on here and on google but cant seem to get it to work.

what i have is
Code:
Me.filter = ("Weekly Takings.date = "" & me.date_select.value & """)
Me.FilterOn = True

all this in an if statment

i am wanting to select a date through a combo box (date select) once selected press a cmd button that will show the records of query weekly sickness that is shown through a report. i also want to send the report to an email address but instead of typing direct to the code i want a setting form that will store the email address just if need to change it i dont have to re write any code.

Any help on this would be great.

Regards

Aidan
 
Two things
1) The date delimiter in VBA is "#", so to do a date comparison do something like this...
Code:
Me.Filter = "Weekly Takings.date = #" & me.date_select.value & "#"
2) "Weekly Takings.date" is wrong. It cannot have a space in the middle, and there is no need here for a "." You are applying a filter to a form, so if the form has a field called 'Date' you can do this:
Code:
Me.Filter = "Date = #" & me.date_select.value & "#"
Does that help?
 
Hi,

think i am getting there have tried to do this in the filter condition in the DoCmd bit to try and stream line the code a bit but comes up with type miss match not sure what is wrong this is filtered through a query then shown in a report is there a diffrent process to this or is it the same.

Regards

Aidan
 

Users who are viewing this thread

Back
Top Bottom