blindlemonray
Technical User
Hi All,
this is the code I am using and I have trawling the forums to try and find an answer but I am stumped. I keep getting error message "too few parameters. expected 1" Can anyone help... Pleeeeeeeeeease!
Many Thansks in advance
this is the code I am using and I have trawling the forums to try and find an answer but I am stumped. I keep getting error message "too few parameters. expected 1" Can anyone help... Pleeeeeeeeeease!
Code:
Dim rst As DAO.Recordset
Dim sBodyText As String
Dim strSQL As String
strSQL = "SELECT Callers_client_planning.User_Name AS Caller, Callers_client_planning.Client, Callers_client_planning.Code, Callers_client_planning.Plan_Hours AS [Planned Hours] From Callers_client_planning WHERE Callers_client_planning.Plan_Hours Is Not Null AND Callers_client_planning.Code= " & [Forms]![Alter_planning]![Text48]
Set rst = CurrentDb.OpenRecordset(strSQL, dbOpensnapshot)
sBodyText = "Caller" & vbTab & "Client" & vbTab & vbTab & vbTab & "Planned Hours" & vbCrLf
While Not rst.EOF
sBodyText = sBodyText & rst.Fields("Caller") & vbTab & vbTab & rst.Fields("Client") & vbTab & vbTab & rst.Fields("Planned Hours") & vbCrLf
rst.MoveNext
Wend
rst.Close
DoCmd.SendObject , , , , , , "Change of Hours", sBodyText, True
Many Thansks in advance