B
Ben Adams
Trying to Export items from a Query "CalenderExport Q" (See Query Below) that
uses imputs from a combo box in a form. Using a function to export the
records to Outlook - However, When it gets to Set rst =
oDataBase.OpenRecordset("CalendarExport Q"), it gives me an error "Too Few
parameters. Expected 3." How can I have it call the records that show when I
open the query?
Function ExportCalendartoOutlook()
Dim oDataBase As DAO.Database
Dim rst As DAO.Recordset
Set oDataBase = CurrentDb
Set rst = oDataBase.OpenRecordset("CalendarExport Q")
More code here, doesn't matter.....
End Function
CalendarExport Q
SELECT [Master Planned].Date, [Activity] & " / " & [Vendor] & " / " &
[Customer Forecasts]!Name AS Subject, [Master Planned].Comments AS Body,
"Sales Plan" AS Category
FROM [Branch Master] LEFT JOIN ([Customer Forecasts] RIGHT JOIN [Master
Planned] ON [Customer Forecasts].[Customer ID] = [Master Planned].[Customer
ID]) ON [Branch Master].[Branch ID] = [Master Planned].[Branch ID]
WHERE ((([Master Planned].Date) Is Not Null) AND
((IIf([Forms]![CalendarExport]![Vendor] Is Not
Null,[Vendor]=[Forms]![CalendarExport]![Vendor],[Vendor] Is Not
Null))<>False) AND ((IIf([Forms]![CalendarExport]![Activity] Is Not
Null,[Activity]=[Forms]![CalendarExport]![Activity],[Activity] Is Not
Null))<>False) AND ((IIf([Forms]![CalendarExport]![Salesperson] Is Not
Null,[Salesperson]=[Forms]![CalendarExport]![Salesperson],[Salesperson] Is
Not Null))<>False))
ORDER BY [Master Planned].Date;
uses imputs from a combo box in a form. Using a function to export the
records to Outlook - However, When it gets to Set rst =
oDataBase.OpenRecordset("CalendarExport Q"), it gives me an error "Too Few
parameters. Expected 3." How can I have it call the records that show when I
open the query?
Function ExportCalendartoOutlook()
Dim oDataBase As DAO.Database
Dim rst As DAO.Recordset
Set oDataBase = CurrentDb
Set rst = oDataBase.OpenRecordset("CalendarExport Q")
More code here, doesn't matter.....
End Function
CalendarExport Q
SELECT [Master Planned].Date, [Activity] & " / " & [Vendor] & " / " &
[Customer Forecasts]!Name AS Subject, [Master Planned].Comments AS Body,
"Sales Plan" AS Category
FROM [Branch Master] LEFT JOIN ([Customer Forecasts] RIGHT JOIN [Master
Planned] ON [Customer Forecasts].[Customer ID] = [Master Planned].[Customer
ID]) ON [Branch Master].[Branch ID] = [Master Planned].[Branch ID]
WHERE ((([Master Planned].Date) Is Not Null) AND
((IIf([Forms]![CalendarExport]![Vendor] Is Not
Null,[Vendor]=[Forms]![CalendarExport]![Vendor],[Vendor] Is Not
Null))<>False) AND ((IIf([Forms]![CalendarExport]![Activity] Is Not
Null,[Activity]=[Forms]![CalendarExport]![Activity],[Activity] Is Not
Null))<>False) AND ((IIf([Forms]![CalendarExport]![Salesperson] Is Not
Null,[Salesperson]=[Forms]![CalendarExport]![Salesperson],[Salesperson] Is
Not Null))<>False))
ORDER BY [Master Planned].Date;