subform afterupdate error

K

Kou Vang

I want to populate a [DateEntered] field in a subform if I modify anything
for the record. I have the following code for the subform:

Me.DateEntered.value = Format(Now, "short date")

When I do this, the subform locks up, and I cannot navigate or do anything.
I have tried to refresh the form, getting the Runtime Error 2115:

The macro or function set to the BeforeUpdate or ValidationRule property
for this field is preventing Microsoft Access from saving the data in the
field.

I don't even have a BeforeUpdate event on my form. Any ideas? Thanks

Kou
 
A

Allen Browne

In what event are you doing this?

Try the BeforeUpdate event of the *form* (not control).

Assming DateEntered is a date time field, just assign the value of Now()
without the format:
Me.DateEntered = Now()

Then verify that that the code compiles (Compile on Debug menu, in code
window.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top