Error '2465' can't find the field '|1' (1 Viewer)

ikzouhetnietweten

Registered User.
Local time
Today, 14:38
Joined
Oct 23, 2015
Messages
44
When I click in the form on the 'TO OUTLOOK' button after filling in some fields i get the error. It used to work but It says there is an expression error. Any idea how to solve it? thanks!

(when clicking on the button, your outlook will open and all the fields will be automatically filled in as a contact in your outlook)

Error: Run-time error '2465' can't find the field '|1' referred to in your expression

Code:
Private Sub Command335_Click()

     With olContact
        .FirstName = Nz([FirstName], "")
        .LastName = Nz([LastName], "")
        .JobTitle = Nz([JobTitle], "")
        .CompanyName = Nz([Company], "")
        .BusinessAddressStreet = Nz([Address], "")
        .BusinessAddressCity = Nz([City], "")
        .BusinessAddressState = Nz([StateProvince], "")
        .BusinessAddressCountry = Nz([CountryRegion], "")
        .BusinessAddressPostalCode = Nz([ZIPPostalcode], "")
        .BusinessTelephoneNumber = Nz([BusinessPhone], "")
        .BusinessFaxNumber = Nz([Faxnumber], "")
        .Email1Address = Nz([EmailAddress], "")
        .MobileTelephoneNumber = Nz([MobilePhone], "")
        .Display 'use .Display if you wish the user to see the contact pop-up .Save to save
    End With
 
Last edited:

molrunner

New member
Local time
Today, 05:38
Joined
Jan 3, 2017
Messages
7
I'm having a similar issue, and i cannot find the cause for this error code.
Run-time Error 2465 Microsoft Access can not find the field '|1' referred to in your expression.

I get this error and i cannot find the reason.
I have a report, no subforms, that is supposed to create a pdf in email for the selected record only.
I have been looking for an answer and most responses say it has to do with a comma, a quote, or a SQL statement. I have no SQls in this, and i cannot see the error in my code.
The weird thing is, this exact code works on a different form, so i am at a loss as to why it does not work on the other.
I do have a reference for the Microsoft Outlook 16 object library on the database, as i thought this might be the cause.
I have tried putting the report name in brackets, i know this is usually if there are spaces in the name, but it still gives me the same error.

Please help if you can.

Private Sub Command73_Click()
DoCmd.OpenReport "rptCIC", acViewPreview, "", "id=" & Me.ID
DoCmd.SendObject acSendReport, "rptCIC", "PDFFormat(*.pdf)", [SendToEmail], "", "Me@email.net", "CIC Report", "Please find requested CIC report", True, ""
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:38
Joined
Sep 21, 2011
Messages
14,256
What is the data source for the report?
 

Micron

AWF VIP
Local time
Today, 08:38
Joined
Oct 20, 2018
Messages
3,478
You have an unqualified field reference for the "To" value? Maybe Me.SendToEmail would work, or a variable. At any rate, To has to be a string reference.
 

molrunner

New member
Local time
Today, 05:38
Joined
Jan 3, 2017
Messages
7
You have an unqualified field reference for the "To" value? Maybe Me.SendToEmail would work, or a variable. At any rate, To has to be a string reference.
Thank you! I got it working! I appreciate
 

Users who are viewing this thread

Top Bottom