Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save current field before requery

Status
Not open for further replies.

ksbigfoot

Programmer
Apr 15, 2002
856
CA
I am using a datasheet and I update a field in my datasheet. In my AfterUpdate event, I call a subroutine that changes the next record based on changes of the first record. I am trying to requery the datasheet, but I am getting the following error message "You must save the current field before you run the Requery action".
I have tried
Code:
Me.Dirty = False 
AND also DoCmd.RunCommand acCmdSaveRecord
and neither one works.
The DoCmd and Me.Dirty are giving the following error message: "The macro or function set to the BeforeUpdate or ValidateRule property for this field is preventing Microsoft Access from saving the data in the field".
Thanks in advance.
 
So, do you have a Validation Rule in the table set for this field, or code in the BeforeUpdate that affects this event?
 
Hi sfreeman,
I didn't have a validation rule, but I do have code in the BeforeUpdate event. What I ended up doing to make it work, is instead of changing the data right on the form, I updated the data in the database and refreshed the form. It seemed to work that way for me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top