Access 2010 returning error code when trying to subform "On Load" event
To create this error: with a tab control, on one of the tabs is a sub-form. When I select the “On Load” event for the subform I get the above error.
Thank you for taking the time to report an issue.
What's wrong... Please write below.
Private Sub Form_Load()
Const dbg = False
2007 displays the following error:-
"the expression On Load you entered as the event property setting produced the following error: Object or class does not support the set of events"
One of the problem is that there is thrown error when referencing sub report in its Open event.
I have a report called Main and it contains subreport control called sbrLine. In sbrLine sub report control I have placed report Line.
Open event of Line report contains following code:
It was working in Access XP, but it fails with error in Access 2010.
The error is #2455 "You entered an expression that has an invalid reference to the property Form/Report."
Is this a bug in Access 2010?
The expression On Load you entered as the event property setting produced the following error: A problem occurred while was communicating with the OLE server or ActiveX Control.
* The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].
* There may have been an error evaluating the function, event, or macro.
in addition, the "Show Help" button on this error message gives the following information:
This error occurs when an event has failed to run because Microsoft Office Access cannot evaluate the location of the logic for the event. For example, if the OnOpen property of a form is set to =[Field], this error occurs because Access expects a macro or event name to run when the event is fired.
I don't really understand what this means, to be honest. the same code/macro combo worked perfectly fine on another form I created (and subsequently lost, which is why I'm recreating it).
Since upgrading to Access 2010 I have been getting a "Property not found" error upon using the existing Save button on multiple forms. The error occurs only when data in the record has changed. Converting the old .mdb file to .accdb format hasn't solved the issue.
The Save buttons have "On Click" event procedures associated with them.
The first one is as follows:
The other one I am having issues with is this, on a different form:
I have no idea where to even start with figuring it out as the error doesn't even try to take me into Debug mode - it's a very unhelpful error with an "OK" button and nothing more!
I have done Compact/Repair. Also when I compiled the code I get a "File Not Found" error.
I don't know what I did - things were working just fine then of a sudden this issue - I was not modifying/adding any code.
This Macro runs against a Form that has a SubFrom (MainForm named "Expense ID" & SubForm, "Expense"). Macro is initiated by pressing a button.
I would like help with some VBA code showing how to perform the following:
1. Evaluate a field ("Activity") in the first record of Subform ("Expense") against condition "Is not Null".
2. If condition is true, set value of another field ("Post") in the same SubForm record to "1".
3. Move to next record and repeat steps 1 & 2 until all Subform records are evaluated.
4. Return to macro that initiated the VBA script to perform the next action in the macro.
While playing with the code I noticed if I take out the "AND" in the bold line above. The error is removed within Access 2010; however, it creates the same error in Access 2007, 2003. We still have a couple users that utilize Access 2007 and need it to function properly in both instances.
This is a program that I have inherited and my programming skills are minimal at best.
I have worked on this for several hours already, or 2007; however, not in both.
For example, if the OnOpen property of a formis set to =[Field], this error occurs because Access expects a macro or event name to run when the event is fired."
I've tried the following code in the Report Event Procedures "On Load" and "On Open" but it does not work
It looks like this:
Hour %: [SumOfOT Hrs]/[SumOfReg Hrs]
One of the entries in the "SumOfReg Hrs" is 0, and that is the one returning the error message. None of the other entries have a "0" in either "sumOfOT Hrs" or SumOfReg Hrs" fields and they return data.
I tried this:
IIf ( IsError ([SumOfOT Hrs]/[SumOfReg Hrs]) , "0", [SumOfOT Hrs]/[SumOfReg Hrs])
But it still gives me the "#Error" message.