Rabu, 25 Oktober 2017

RE: [MS_AccessPros] VBA Select statement Error

 

The problem is with part of sentence SupervisorTableWithEmail.EmailReportsTo = True , try this SupervisorTableWithEmail.EmailReportsTo = -1 and it will be work fine.

 

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com]
Sent: Wednesday, October 25, 2017 1:45 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] VBA Select statement Error

 

 

Jim,

 

Debug.Print is your best friend (other than this group) when you have VBA issues.

 

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

 

Debug.Print strSQL1

 

Take the output from the debug window and paste it into the SQL view of a new query. Usually this error message suggests:

  • You have misspelled a table or field name
  • You have a reference to a control on a form in your query

 

Regards,

Duane


From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of luvmymelody@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Wednesday, October 25, 2017 1:38 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [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: "RobertoARV" <robertoarv@yahoo.com.mx>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

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