F
Fred
I have been searching out VB code to accomplish a simple task and keep
running into snags. I have a form including these fields:
- CourseName
- CourseNumber
- ProjectCoordinator
- email
The "ProjectCoordinator" control on the Courses form is a combo box
drawing from a related table called (T) Names. The "email" control is
automatically populated when the name is chosen.
I want to create a button that, when clicked, creates an email in
Outlook 2003 to the Project Coordinator and tells them that their
learning module has been uploaded and is ready for the staff.
Here is the code I have so far - it is edited from the closest I could
find in another message here.
Private Sub Command231_Click()
Dim strTo As String
Dim strBody As String
Dim strSubject As String
strTo = DLookup(email, "(T) Names", "Name = " & Me.ProjectCoordinator)
strBody = "Your CBL with the title and course number shown above has
been published in the Learning Management System and is available for
staff."
strSubject = "Learing Module information"
DoCmd.SendObject , , acFormatTXT, strTo, , , strSubect, strBody, True
End Sub
I am getting an error in the strTo line = Runtime error 3705. Syntax
error (missing operator) in query expression '(e-mail address removed)'
Is this ensough info to tell where I am messing up?
Thanks,
Fred
running into snags. I have a form including these fields:
- CourseName
- CourseNumber
- ProjectCoordinator
The "ProjectCoordinator" control on the Courses form is a combo box
drawing from a related table called (T) Names. The "email" control is
automatically populated when the name is chosen.
I want to create a button that, when clicked, creates an email in
Outlook 2003 to the Project Coordinator and tells them that their
learning module has been uploaded and is ready for the staff.
Here is the code I have so far - it is edited from the closest I could
find in another message here.
Private Sub Command231_Click()
Dim strTo As String
Dim strBody As String
Dim strSubject As String
strTo = DLookup(email, "(T) Names", "Name = " & Me.ProjectCoordinator)
strBody = "Your CBL with the title and course number shown above has
been published in the Learning Management System and is available for
staff."
strSubject = "Learing Module information"
DoCmd.SendObject , , acFormatTXT, strTo, , , strSubect, strBody, True
End Sub
I am getting an error in the strTo line = Runtime error 3705. Syntax
error (missing operator) in query expression '(e-mail address removed)'
Is this ensough info to tell where I am messing up?
Thanks,
Fred