P
Phil
I have been working on this code for a few days with a lot of help from here
and have now hit a brick wall, and cannot see where else to go
Again I apologise for it being a long post to give you all the info you will
need.
the code I have written is meant to get a concatenated list of email
addresses in a format that can be passed to outlook as a to:
I get a series of errors:
The specified field [EventID] could refer to mero than one table listed in
the from clause of your SQL statement.
Error 2147024894 - the system cannot find the specified file
Error 53: file not found
the code is:
Private Sub Command39_Click()
Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim strEmail As String
Dim sParam As String
Set db = CurrentDb()
Set qdf = db.QueryDefs("Emailteacher")
sParam = Nz(Forms![Events1]![EventID], "")
qdf.Parameters![Em] = sParam
Set rst = qdf.OpenRecordset
With rst
If (Not .BOF) And (Not .EOF) Then
.MoveFirst
strEmail = Nz(.Fields("email"))
.MoveNext
End If
If (Not .BOF) And (Not .EOF) Then
Do Until .EOF
strEmail = strEmail & ", " & .Fields("email")
.MoveNext
Loop
End If
.Close
End With
EMailAsPDF "Timetable", strEmail, Me.[EventName] & " " & "Cohort " &
Me.[Cohort] & " Timetable", "Enter Your Text Here"
End Sub
The SQL for the form is: SELECT Events.EventID, Events.EventName,
Events.Cohort, Events.StartDate
FROM Events
WHERE (((Events.StartDate)>Date()));
The SQL for the query is:
SELECT DISTINCT Teacher.Email, Sessions.EventID
FROM Sessions INNER JOIN Teacher ON Sessions.TeacherID = Teacher.TeacherID
WHERE (((Sessions.EventID)=[Em]));
thanks in advance for anyone who can help
Phil
and have now hit a brick wall, and cannot see where else to go
Again I apologise for it being a long post to give you all the info you will
need.
the code I have written is meant to get a concatenated list of email
addresses in a format that can be passed to outlook as a to:
I get a series of errors:
The specified field [EventID] could refer to mero than one table listed in
the from clause of your SQL statement.
Error 2147024894 - the system cannot find the specified file
Error 53: file not found
the code is:
Private Sub Command39_Click()
Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim strEmail As String
Dim sParam As String
Set db = CurrentDb()
Set qdf = db.QueryDefs("Emailteacher")
sParam = Nz(Forms![Events1]![EventID], "")
qdf.Parameters![Em] = sParam
Set rst = qdf.OpenRecordset
With rst
If (Not .BOF) And (Not .EOF) Then
.MoveFirst
strEmail = Nz(.Fields("email"))
.MoveNext
End If
If (Not .BOF) And (Not .EOF) Then
Do Until .EOF
strEmail = strEmail & ", " & .Fields("email")
.MoveNext
Loop
End If
.Close
End With
EMailAsPDF "Timetable", strEmail, Me.[EventName] & " " & "Cohort " &
Me.[Cohort] & " Timetable", "Enter Your Text Here"
End Sub
The SQL for the form is: SELECT Events.EventID, Events.EventName,
Events.Cohort, Events.StartDate
FROM Events
WHERE (((Events.StartDate)>Date()));
The SQL for the query is:
SELECT DISTINCT Teacher.Email, Sessions.EventID
FROM Sessions INNER JOIN Teacher ON Sessions.TeacherID = Teacher.TeacherID
WHERE (((Sessions.EventID)=[Em]));
thanks in advance for anyone who can help
Phil