Jean-Didier
New member
- Local time
- Today, 02:08
- Joined
- Mar 26, 2010
- Messages
- 8
Hello
I need you help please.
i have made an unmatched query and in my macro, i would like the database send me an email with an excel file, ONLY if there are some data in the query.
If the query is empty, no email
i've found this code but i dont know where i can put this code.. in a module, in a macro ?
I'm a beginner in access, thank you for your help
Jean-Didier (and sorry for my very bad english ...)
I need you help please.
i have made an unmatched query and in my macro, i would like the database send me an email with an excel file, ONLY if there are some data in the query.
If the query is empty, no email
i've found this code but i dont know where i can put this code.. in a module, in a macro ?
Code:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordSet("QueryName")
rs.MoveLast
rs.MoveFirst
If rs.RecordCount = 0 Then
Exit Sub
Else
' Put your sendobject code here
End If
I'm a beginner in access, thank you for your help
Jean-Didier (and sorry for my very bad english ...)