Save Code

jcruzAME

Registered User.
Local time
Today, 04:47
Joined
Oct 5, 2011
Messages
135
Currently having an issue with something that was working Friday and now after replacing my SQL Server install that was having some issues, doesn't work anymore.

I've tried Me.Dirty = True and DoCmd.RunCommand acCmdSaveRecord to save the record before updating some recordsources on other forms. On Friday, the code would save the record and successfully and when I would run the code that re-queries the other forms the new record would show up.

Now, when I try to do the same thing the record doesn't show up in the table until after the form closes. The two lines of code above I've tried (with the If Me.Dirty = True Then Me.Dirty = False), and I can't get the new record to show up.

Any thoughts?
 
Hi Pat, thanks for the response.

I have a Save button and a Close button. The save button checks to see if the form is Dirty, if it is I do Dirty = False.

Then it reruns the queries that are the record source of the other form (which is open but not visible). At the end of all that code I requery the non-visible form. Then the top form close and this one is set to visible again, and data should be refreshed.

When I step through the code, the new record doesn't appear in the table until the form is completely closed.

Last Friday this code was working for me, with a new record appearing in the requeried recordsource of the hidden form.

EDIT: Also, the save is located in the save button on click, and the requery code happens on unload. It was in the form close section.
 
Thanks for the response Pat, I figured out what my problem was. One of the fields wasn't getting set when entering the information, but I'm not 100% sure how that was keeping the record from being saved.
 

Users who are viewing this thread

Back
Top Bottom