Error 2950

GregMiller

Registered User.
Local time
Yesterday, 17:43
Joined
Dec 5, 2019
Messages
18
I have a database from which I need to send a form by e-mail to selected recipients. I use a combobox to allow the user to select each recipient in turn and then click a button to produce the email and its attachment. This worked perfectly in one database (Messenger email test.accdb) but when I tried to use the same method in another database (GA by Email.accdb) I get an error 2950. I have made the location of the second database a trusted location but I still get the error 2950. I assume there must be some small difference in the second database that is causing the problem but I can’t see what it is. Can somebody with a sharper eye or more experience tell me where the problem is?
 

Attachments

You really need to learn VBA. :(
Trying to debug a macro is a nightmare. 🤬

Eventually I tracked it down to this I believe
Code:
=DLookUp("GACurYrwTotEmail!Email","GACurYrwTotEmail]","GACurYrwTotEmail![Diocese Number]= " & [Combo29])

I'd tidied the combo up, numeric, so no need for quotes, that would cause an error as well. I tried a hardcoded email address and that worked.

Came down to a missing [ for the domain name I believe.?

FWIW to avoid more mistakes like this, you are given the function the domain so,

Code:
=DLookUp("Email","[GACurYrwTotEmail]","[Diocese Number]= " & [Combo29])
is less to type and so less prone to errrors.

Edit: I also got the 2950 message before fixing the DB

HTH
 
This is the message I get when I try to run the procedure. It is said that the error often arises when the database is not trusted by Access but that should have been resolved by making the database location a trusted location.
 

Attachments

  • Screenshot_38.png
    Screenshot_38.png
    10.2 KB · Views: 575
You really need to learn VBA. :(
Trying to debug a macro is a nightmare. 🤬

Eventually I tracked it down to this I believe
Code:
=DLookUp("GACurYrwTotEmail!Email","GACurYrwTotEmail]","GACurYrwTotEmail![Diocese Number]= " & [Combo29])

I'd tidied the combo up, numeric, so no need for quotes, that would cause an error as well. I tried a hardcoded email address and that worked.

Came down to a missing [ for the domain name I believe.?

FWIW to avoid more mistakes like this, you are given the function the domain so,

Code:
=DLookUp("Email","[GACurYrwTotEmail]","[Diocese Number]= " & [Combo29])
is less to type and so less prone to errrors.

Edit: I also got the 2950 message before fixing the DB

HTH
Thanks for your help Gasman that works perfectly. I did teach myself Visual Basic about 25 years ago but then didn't use it much. What I need to get my head around is the interface between Access and VBA.
 
please see if it is fixed.
i used VBA.
 

Attachments

For the record, error 2950 is "Unable to run action" - most likely a macro, according to the more detailed description. I offer this only so that readers will understand the error, because it seems my colleagues have pointed out the REASON that Access was unable to run the action.
 
"GACurYrwTotEmail]"

As @Gasman pointed out, the error was probably the unpaired square bracket in the above term, Obviously not an error that the compile was programmed to check for in particular.
 
please see if it is fixed.
i used VBA.
Thanks Arnelgp that works too. It is also useful to have an example of VB code to help me come to grips with the interface between Access and VBA.
 

Users who are viewing this thread

Back
Top Bottom