MarkK
bit cruncher
- Local time
- Today, 02:29
- Joined
- Mar 17, 2004
- Messages
- 8,472
Cool, so a few observations if you want.
You declare db and assign it CurrentDb, but you never actually use it, so we can remove that . . .
Simillarly, you never use rs, or stSQL, so we refactor some more . . .
stEmailRecips, you declare, assign a value, and use, but we can tighten that up by using Me.Email directly . . .
. . . and the same thing with stSubject . . .
. . . and finally, we can add a line continuation character, so we can see the whole line . . .
So we've reduced it to it's bare essentials. Everything has a distinct purpose, and there is no wasted code. Do you see what happened there?
You declare db and assign it CurrentDb, but you never actually use it, so we can remove that . . .
Code:
Private Sub Command20_Click()
Dim stEmailRecips As String
Dim stSubject As String
Dim stSQL As String
Dim Rs As DAO.Recordset
stSQL = "SELECT Email FROM Invoices Query;"
stEmailRecips = Me.Email
stSubject = ("New Invoice Added")
DoCmd.SendObject acSendNoObject, , , stEmailRecips, , , stSubject, "A new invoice has been created at RGRoofing.UK please click here http://www.RGRoofing.uk"
End Sub
Code:
Private Sub Command20_Click()
Dim stEmailRecips As String
Dim stSubject As String
stEmailRecips = Me.Email
stSubject = ("New Invoice Added")
DoCmd.SendObject acSendNoObject, , , stEmailRecips, , , stSubject, "A new invoice has been created at RGRoofing.UK please click here http://www.RGRoofing.uk"
End Sub
Code:
Private Sub Command20_Click()
Dim stSubject As String
stSubject = ("New Invoice Added")
DoCmd.SendObject acSendNoObject, , , Me.Email, , , stSubject, "A new invoice has been created at RGRoofing.UK please click here http://www.RGRoofing.uk"
End Sub
Code:
Private Sub Command20_Click()
DoCmd.SendObject acSendNoObject, , , Me.Email, , , "New Invoice Added", "A new invoice has been created at RGRoofing.UK please click here http://www.RGRoofing.uk"
End Sub
Code:
Private Sub Command20_Click()
DoCmd.SendObject acSendNoObject, , , Me.Email, , , "New Invoice Added", _
"A new invoice has been created at RGRoofing.UK please click here http://www.RGRoofing.uk"
End Sub