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: 38
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

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

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.

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


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

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

After update of check box gives error

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.

Run time error : the expression may not result in the name of a macro

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

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

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

2113 Error happening from Access 2003 to 2010

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.

Scheduling Updates On Timer (ARRGH!!)

I have a db which is split front and back and is deployed via RDS to quite a few users.

The problem I have is, a function which is used a lot triggers a series of queries which on their own run fine, however as it's used by about 10 users it's causing the db to crash.

The queries which are running only need to be ran once every 5 minutes or so, so, what I'm looking to do is scheduale a SINGLE update to happend every 5 mins so that only one event of th query happens.

The only way I can think to do this is to have a manager (1 user only) open a form in the background which triggers the event every 5 mins (not sure how to run a macro on a loop on timer in VBA).

Does anyone have any better ways? (If my rambling above makes any sense

Run time error 7878

I'm relatively new to access and i've just designed a database using some vba code. Sometimes when I'm using a form an error box comes up saying run time error 7878. What does this error mean?
Its not causing a major functionality issue but it does make it a lot easier for users to get to the coding through the debug button which I don't want to happen