Topics Search

VBA not running in after update event. Run-time error '2113'

VBA not running in after update event. Run-time error '2113'
Views: 34
I have a sample database set up in access 2007 and please see the attached.

There is VBA code behind ED_disposition field in the after update event.

When I change its value, I keep getting a run-time error "2113", saying the value you entered isn't valid for this field.

I am not sure what my problem is. Does this have to do with table level look up again?

Also, is it legitimate to write 3 if statements the way I did in the code? They are basically 3 scenario checks
Sponsored Links:

More topics

 

Error "Run-time error '1004': General ODBC Error

Preview
I'm having trouble running a file that I run weekly, when running the update query I receive error message: "Run-time error '1004': General ODBC Error

When I run debug, it fails at the 2nd line of code below:
....

My excel links the CCL data from Access via the below details and from what I know, nothing has changed. I've googled the error and it seems to mention an awful lot that there could be a problem with the link but I'm very inexperienced with Access and not quite sure where I should be looking.
 

Error Message when running 'On Load' VBA code / Macro

Preview
I've entered some code in the 'On Load' portion of my main form, designed to pop up a confirmation dialog asking the user if they want to run a macro to update the DB's tables with current data from some linked tables. when loading the form, however, I get this message:

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).
 

Can't Assign a Value.

Preview
In Access 2010, when trying to assign a textbox a value using VBA code I'm presented with this error:

Quote:

Run-time error '-2147352567 (80020009)':
You can't assign a value to this object.

What I'm trying to do is record the date and time whenever a record is modified. I'm using the "Before Update" event to run the following code:
....

I don't know why it won't work. This is something that seems about as simple as it gets. I've Googled the error and everyone is suggesting missing references and untrusted locations as thecause but neither of those apply to this as I have no missing references and the location is trusted.
 

VBA to update field contents...Error 91

Preview
I know this is probably something basic but my VBA knowlege is pretty limited. I am trying to update a field After Update in a form using the following code but getting an error message - "Run-time error '91': Object variable or With block variable not set"...
 

Run time error

Preview
I had running program which a data can be exported to excel. using the outputto command. It give a runtime error: "the expression may not result in the name of a macro, the name of a use defined function, or [Event Procedure] here may have been error evaluating the function event, or macro." on a new laptop where it is running windows 7 home edition and office 2003. But when I run the program on my pc, windows 7 also and access 2003, no problem
 

Run time error

Preview
I had running program which a data can be exported to excel. using the outputto command. It give a runtime error: "the expression may not result in the name of a macro, the name of ause defined function, or [Event Procedure] here may have been error evaluating the function event, or macro." on a new laptop where it is running windows 7 home edition and office 2003.But when I run the program on my pc, windows 7 also and access 2003, no problem.
 

After update of check box gives error

Preview
I have a check box on a form and was trying to write code for the after_update event.

"The expression After Update you entered as the event property setting produced the following error: A problem occurred while Genetic Disease Database was communicating with the OLE Server or Active X control"

Not sure why this is occurring.
....
and in the property of the check box is Event - after update : is [event procedure]

Haven't had trouble like this elsewhere.

I tried commenting out the code and still get the error. I tried a new check box and still get the error.
I tried the code in "on click" and still got the error.

Can you not have any event procedures for a check box? How am I supposed to handle this in VBA? I need to do is open a new form if check box is checked.
 

Custom Error-Handling (Run-Time Error '490')

Preview
I have a command button that opens PDF files stored in multiple folders, but I'm trying to create a customized error-handling message to replace the "Run-Time Error '490'" error that is displayed when the database cannot find the specified file.

Since I'm pretty sure that this procedure needs to be coded with the OnClick event, I'd like to create a vbOKonly message that tells users the PDF file does not exist because the criteria on the FollowHyperlink string is not met.

I have a small grasp of error-handling, but I can't seem to complete the full procedure and resume normal functions (due to the VBA syntax errors I keep stumbling on
 

Running an Update Query from Excel

Preview
I’ve done a whole load of searching and come to a dead end regarding running an Update Query from Excel.

I have 35 fields in my Update Query, with each one having an ‘IIf’ formula. My Excel sheet if populated using SQl linked to Access. I then add figures required and run the Update query.

I would ideally like run some VBA that runs the Update Query. But it seams so complicated.
 

2113 Error happening from Access 2003 to 2010

Preview
I'm just filling in for the "Access" guy that left the company. I have a .mdb that works fine in Access 2003. I get a 2113 error, "The value you entered isn't valid for this field.", in Access 2010.
This error happens when I do the following.

1) Select an item from a combo box. (data from another table)
2) Next, click a button to open another form.
3) This action should take the data from the combo box, then query a table for info that will be displayed in the next form.

Like I said earlier, it works great in 2003. I've been told that it may be a reference issue.