the following code is generating an error; [2465] Mircosoft Access cant find the field '|" referred to in your expression"
any suggestions would be appreciated. -
Private Sub Expire_Date_Qry_Parameter_AfterUpdate()
-
On Error GoTo Err_Hndlr
-
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Temp_Parameter = Forms!F_Contract_Mgt_Entry!Expire_Date_Qry_Parameter
-
DoCmd.OutputTo acOutputQuery, stDocName, [Excel 97 - Excel 2003 Workbook (*.xls)], AutoStart
-
-
MsgBox "Task Complete!"
-
-
-
Exit_Expire_Date_Qry_Parameter_AfterUpdate:
-
Exit Sub
-
-
Err_Hndlr:
-
MsgBox "[" & Err.Number & "]: " & Err.Description, vbInformation, "Expire_Date_Qry_Parameter_AfterUpdate()"
-
End Sub
-
11 4551 @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?
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.
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.
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)?
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.
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.
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: -
-
Option Compare Database
-
-
-
Private Sub Contract_Mgt_Rpt_by_Contract_Status_Click()
-
-
On Error GoTo Err_Hndlr
-
-
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Temp_Parameter = Null
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Qry_Parameter = Null
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter = Null
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter.Visible = True
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Qry_Parameter.Visible = False
-
stDocName = "R_Contract_Status"
-
-
-
Exit_Contract_Mgt_Rpt_by_Contract_Status_Click:
-
Exit Sub
-
-
Err_Hndlr:
-
MsgBox "[" & Err.Number & "]: " & Err.Description, vbInformation, "Contract_Mgt_Rpt_by_Contract_Status_Click()"
-
-
End Sub
-
-
Private Sub Expire_Date_Rpt_Parameter_AfterUpdate()
-
-
On Error GoTo Err_Hndlr
-
-
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Temp_Parameter = Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter
-
DoCmd.OpenReport stDocName, acPreview
-
-
-
Exit_Expire_Date_Rpt_Parameter_AfterUpdate:
-
Exit Sub
-
-
Err_Hndlr:
-
MsgBox "[" & Err.Number & "]: " & Err.Description, vbInformation, "Expire_Date_Rpt_Parameter_AfterUpdate()"
-
End Sub
-
-
Private Sub Expire_Date_Rpt_Parameter_Enter()
-
On Error GoTo Err_Hndlr
-
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter = Null
-
-
Exit_Expire_Date_Rpt_Parameter_Enter:
-
Exit Sub
-
-
Err_Hndlr:
-
MsgBox "[" & Err.Number & "]: " & Err.Description, vbInformation, "Expire_Date_Rpt_Parameter_Enter()"
-
-
End Sub
-
-
Private Sub Expire_Date_Qry_Parameter_AfterUpdate()
-
On Error GoTo Err_Hndlr
-
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Temp_Parameter = Forms!F_Contract_Mgt_Entry!Expire_Date_Qry_Parameter
-
DoCmd.OutputTo acOutputQuery, stDocName, [Excel 97 - Excel 2003 Workbook (*.xls)], AutoStart
-
-
MsgBox "Task Complete!"
-
-
-
Exit_Expire_Date_Qry_Parameter_AfterUpdate:
-
Exit Sub
-
-
Err_Hndlr:
-
MsgBox "[" & Err.Number & "]: " & Err.Description, vbInformation, "Expire_Date_Qry_Parameter_AfterUpdate()"
-
End Sub
-
-
Private Sub Expire_Date_Qry_Parameter_Enter()
-
On Error GoTo Err_Hndlr
-
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter = Null
-
-
Exit_Expire_Date_Qry_Parameter_Enter:
-
Exit Sub
-
-
Err_Hndlr:
-
MsgBox "[" & Err.Number & "]: " & Err.Description, vbInformation, "Expire_Date_Qry_Parameter_Enter()"
-
End Sub
-
-
Private Sub ExportContractData_Click()
-
-
On Error GoTo Err_Hndlr
-
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Temp_Parameter = Null
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Qry_Parameter = Null
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter.Visible = False
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Qry_Parameter.Visible = True
-
stDocName = "Q_2_Recs_<_ExpireDateParameter"
-
-
Exit_ExportContractData_Click:
-
Exit Sub
-
-
Err_Hndlr:
-
MsgBox "[" & Err.Number & "]: " & Err.Description, vbInformation, "ExportContractData_Click()"
-
End Sub
-
-
-
for some odd reason, i believe it is the following statement in the code: -
-
DoCmd.OutputTo acOutputQuery, stDocName, [Excel 97 - Excel 2003 Workbook (*.xls)], AutoStart
-
-
Got it...the solution the error code is the syntax for the output...the code should be: - 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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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
|
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
|
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?
|
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
|
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()
| |
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
|
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
|
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
|
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
|
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,...
|
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...
| |
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,...
|
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...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |