Rabu, 25 Oktober 2017

[MS_AccessPros] VBA Select statement Error

 

Hello all,


I needed to change a strSQL to accommodate a check box to email reports to. The user wanted to choose from a table those supervisors that should get an email with a report.


The original line states the following


strSQL1 = "SELECT [R&D-CURRENTEMPLOYEES].[Asu Email Addr] FROM [R&D-CURRENTEMPLOYEES] WHERE [R&D-CURRENTEMPLOYEES].[Person Nm]='" & SupervisorName & "'"



then I changed it to a new table


strSQL1 = "SELECT SupervisorTableWithEmail.[Asu Email Addr] FROM SupervisorTableWithEmail WHERE SupervisorTableWithEmail.EmailReportsTo = True AND SupervisorTableWithEmail.[Person Nm]='" & SupervisorName & "'"


But I am getting the following error


Run-Time error '3061'

Too Few parameters. Expected 2.


SupevisorName is the value of a union query which produces the Supervisor Name.


What is the 2 parameters that I need?


Thank You

Jim Wagner



__._,_.___

Posted by: luvmymelody@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar