473,810 Members | 3,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error; [2465] Mircosoft Access cant find the field '|" referred to in your expression

133 New Member
the following code is generating an error; [2465] Mircosoft Access cant find the field '|" referred to in your expression"

any suggestions would be appreciated.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Expire_Date_Qry_Parameter_AfterUpdate()
  2.   On Error GoTo Err_Hndlr
  3.  
  4.     Forms!F_Contract_Mgt_Entry!Expire_Date_Temp_Parameter = Forms!F_Contract_Mgt_Entry!Expire_Date_Qry_Parameter
  5.     DoCmd.OutputTo acOutputQuery, stDocName, [Excel 97 - Excel 2003 Workbook (*.xls)], AutoStart
  6.  
  7.    MsgBox "Task Complete!"
  8.  
  9.  
  10. Exit_Expire_Date_Qry_Parameter_AfterUpdate:
  11.     Exit Sub
  12.  
  13. Err_Hndlr:
  14.     MsgBox "[" & Err.Number & "]:  " & Err.Description, vbInformation, "Expire_Date_Qry_Parameter_AfterUpdate()"
  15. End Sub
  16.  
May 14 '10 #1
11 4551
Jim Doherty
897 Recognized Expert Contributor
@dowlingm815
There is nothing in your code to suggest what stDocName is.
Is the query that presumably is stDocName getting its value from the form control Expire_Date_Tem p_Parameter? If so what does the query syntax say?
May 14 '10 #2
dowlingm815
133 New Member
stDocName is a global variable. Depending the client's response, stDocName receives a Query Export, as in this case, or Report Preview. The Query receives date parameters from the form.

unfortunately, i don't have access to the code until monday.
May 15 '10 #3
NeoPa
32,579 Recognized Expert Moderator MVP
Posting the full error message is helpful. Identifying the line the error occurred on would be even more helpful. I guess it's probably line #5, but confirmation would be good.
May 15 '10 #4
NeoPa
32,579 Recognized Expert Moderator MVP
If this is indeed the case then I expect the problem is within your query rather than the VBA code.

What happens when you try running the query normally (to show on screen) at the point this crashes (I'm talking about suspending the code to do the test)?
May 15 '10 #5
dowlingm815
133 New Member
the non-vba query has a field name "ExpirationDate " that will receive the value from the form's field. the criteria is "<[Forms]![F_Contract_Mgt_ Entry]![Expire_Date_Qry _Parameter]"

everything looks fine to me. funny thing is the query is called twice with two separate conditions. the first condition generates a report, the other condition, this condition, generates a query to be exported.
May 17 '10 #6
NeoPa
32,579 Recognized Expert Moderator MVP
Could you explain that second paragraph. I couldn't work out what you were trying to say.

If it helps, drop the relevant code in.
May 18 '10 #7
dowlingm815
133 New Member
The application has a screen that offers three choices. When the second or third choice is selected, the event procedure kicks off a query that receives a date field from the screen. there are two different date fields to coordinate with the user's selection.

the code has a temp field that receives the date value and passes it to a query. when the second choice is selected, the query runs without errors. when the third choice is selected, the following error code is generated:

[2465] Mircosoft Access cant find the field '|" referred to in your expression"

when the query has the parameter removed, no error is generated. again, what is brothersome, it basically runs the same code for the second selection, and generates an error on the third run.

the entire code is as follows:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Option Compare Database
  3.  
  4.  
  5. Private Sub Contract_Mgt_Rpt_by_Contract_Status_Click()
  6.  
  7. On Error GoTo Err_Hndlr
  8.  
  9.  
  10.     Forms!F_Contract_Mgt_Entry!Expire_Date_Temp_Parameter = Null
  11.     Forms!F_Contract_Mgt_Entry!Expire_Date_Qry_Parameter = Null
  12.     Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter = Null
  13.     Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter.Visible = True
  14.     Forms!F_Contract_Mgt_Entry!Expire_Date_Qry_Parameter.Visible = False
  15.     stDocName = "R_Contract_Status"
  16.  
  17.  
  18. Exit_Contract_Mgt_Rpt_by_Contract_Status_Click:
  19.     Exit Sub
  20.  
  21. Err_Hndlr:
  22.     MsgBox "[" & Err.Number & "]:  " & Err.Description, vbInformation, "Contract_Mgt_Rpt_by_Contract_Status_Click()"
  23.  
  24. End Sub
  25.  
  26. Private Sub Expire_Date_Rpt_Parameter_AfterUpdate()
  27.  
  28. On Error GoTo Err_Hndlr
  29.  
  30.  
  31.     Forms!F_Contract_Mgt_Entry!Expire_Date_Temp_Parameter = Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter
  32.     DoCmd.OpenReport stDocName, acPreview
  33.  
  34.  
  35. Exit_Expire_Date_Rpt_Parameter_AfterUpdate:
  36.     Exit Sub
  37.  
  38. Err_Hndlr:
  39.     MsgBox "[" & Err.Number & "]:  " & Err.Description, vbInformation, "Expire_Date_Rpt_Parameter_AfterUpdate()"
  40. End Sub
  41.  
  42. Private Sub Expire_Date_Rpt_Parameter_Enter()
  43.  On Error GoTo Err_Hndlr
  44.  
  45.  Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter = Null
  46.  
  47. Exit_Expire_Date_Rpt_Parameter_Enter:
  48.     Exit Sub
  49.  
  50. Err_Hndlr:
  51.     MsgBox "[" & Err.Number & "]:  " & Err.Description, vbInformation, "Expire_Date_Rpt_Parameter_Enter()"
  52.  
  53. End Sub
  54.  
  55. Private Sub Expire_Date_Qry_Parameter_AfterUpdate()
  56.   On Error GoTo Err_Hndlr
  57.  
  58.     Forms!F_Contract_Mgt_Entry!Expire_Date_Temp_Parameter = Forms!F_Contract_Mgt_Entry!Expire_Date_Qry_Parameter
  59.     DoCmd.OutputTo acOutputQuery, stDocName, [Excel 97 - Excel 2003 Workbook (*.xls)], AutoStart
  60.  
  61.    MsgBox "Task Complete!"
  62.  
  63.  
  64. Exit_Expire_Date_Qry_Parameter_AfterUpdate:
  65.     Exit Sub
  66.  
  67. Err_Hndlr:
  68.     MsgBox "[" & Err.Number & "]:  " & Err.Description, vbInformation, "Expire_Date_Qry_Parameter_AfterUpdate()"
  69. End Sub
  70.  
  71. Private Sub Expire_Date_Qry_Parameter_Enter()
  72.  On Error GoTo Err_Hndlr
  73.  
  74.  Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter = Null
  75.  
  76. Exit_Expire_Date_Qry_Parameter_Enter:
  77.     Exit Sub
  78.  
  79. Err_Hndlr:
  80.     MsgBox "[" & Err.Number & "]:  " & Err.Description, vbInformation, "Expire_Date_Qry_Parameter_Enter()"
  81. End Sub
  82.  
  83. Private Sub ExportContractData_Click()
  84.  
  85.  On Error GoTo Err_Hndlr
  86.  
  87.  Forms!F_Contract_Mgt_Entry!Expire_Date_Temp_Parameter = Null
  88.  Forms!F_Contract_Mgt_Entry!Expire_Date_Qry_Parameter = Null
  89.     Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter.Visible = False
  90.     Forms!F_Contract_Mgt_Entry!Expire_Date_Qry_Parameter.Visible = True
  91.     stDocName = "Q_2_Recs_<_ExpireDateParameter"
  92.  
  93. Exit_ExportContractData_Click:
  94.     Exit Sub
  95.  
  96. Err_Hndlr:
  97.     MsgBox "[" & Err.Number & "]:  " & Err.Description, vbInformation, "ExportContractData_Click()"
  98. End Sub
  99.  
  100.  
  101.  
May 18 '10 #8
dowlingm815
133 New Member
for some odd reason, i believe it is the following statement in the code:

Expand|Select|Wrap|Line Numbers
  1.  
  2.  DoCmd.OutputTo acOutputQuery, stDocName, [Excel 97 - Excel 2003 Workbook (*.xls)], AutoStart
  3.  
  4.  
May 18 '10 #9
dowlingm815
133 New Member
Got it...the solution the error code is the syntax for the output...the code should be:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OutputTo acQuery, stDocName, "MicrosoftExcelBiff8(*.xls)", "", True, "", 0
** Edit **
The explanation is that quotes are needed around the format parameter. Changing the value of the parameter (as shown here) was not relevant.
May 18 '10 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1939
by: Jibu | last post by:
Hi I am using SmtpMail class for mail sending. I could able to send mail using my mailse server to our LAN. But when I tried external addresses it showed the exception Message "Could not access 'CDO.Message' object.". Can anybody help me to solve this probelm
0
1895
by: Jon | last post by:
If anyone can help...Whenevr I go into a form and use the ctrl+F to find something with the binoculars the "Search field as formatted" is checked as default. This seems to slow down the find considerably. If I uncheck it the search is usually instant. The problem is I dont always rememeber to uncheck it. Does anyone know a way to permantly change the default? Thank You
4
8978
by: Bruce Skamser | last post by:
I added a field to a table and when I go to the form to add a textbox control, I can't bind it to the field in the table. It doesn't come up in the list of fields in the control source dropdown. What can I be doing wrong?
7
2803
by: musclemilk | last post by:
Good day, now i know that someone was having the same error message and i read the thread but didnt help me out too much! so basically i have a command button that on a form that needs to open another form and give me the details of the current record that was selected on the previous form. here is the code i am using: Private Sub ouvrir_détails_location_Click() On Error GoTo Err_ouvrir_détails_location_Click
3
2471
by: ontherun | last post by:
hi, i have two forms CHS_Customer and 'CHS_Job' both have a common field, "Company_Name" i want to open the form 'CHS_Job' from the form 'CHS_Customer ' and when i open, the Company_Name field value in 'CHS_Customer' but be assigned to Company_name field in 'CHS_Job' i have written some code for the button "Enter Job" in the Form 'CHS_Customer ' Private Sub EnterJobLabel_Click()
4
3228
kcdoell
by: kcdoell | last post by:
Hello: I have the following afterupdate event: Private Sub GWP_AfterUpdate() 'Updates the Total calculation in the control "SumGWP" on the quick reference 'table that is located on the form With Me! DoCmd.Requery
2
2376
by: zufie | last post by:
I have an Option GROUP which produces 6 different report between two dates. A separate Option BUTTON determines the period of the report once I enter the From & To Dates into the textboxes. I have deleted 5 of the 6 options (radio buttons) within the Option GROUP. Now when I run the report I receive Run-Time Error 2465 - "MS Access
2
4774
by: shalskedar | last post by:
I 've created Report in Ms access which contains subform.The field value in the report is retrieved from the subform.When this report is exported,it shows the error as The expression you entered has a field,control or property name that Access can't find
8
1924
by: Slamowitz | last post by:
I have as client database (Access 2000) that runs fine, but every time I either do a Repair/Compress, Import it into a new blank database or make any vba code changes to it I get a Run-time error 2465 pointing to one of my controls. Any suggestions would be appreciated
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10644
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10393
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.