You can’t save this record at this time (1 Viewer)

mrheffner

Registered User.
Local time
Today, 12:25
Joined
Jul 29, 2019
Messages
10
Hello,


I am getting this message after updating any field on my form then exiting then form with the x on the tab. All other forms seem to be working fine. Even the sub forms on this form. The full text of the message is:
You can’t save this record at this time. Also, after exiting the re-entering the form my changes are actually there.
Microsoft Access may have encountered an error while trying to save a record. If you close this object now, the data changes you made will be lost. Do you want to close the database object anyway?
Yes/No
I have looked at a number of posts in different forums across the web, but none seem to apply to my situation. Some of them recommend implementing extensive error handling routines. That seems like a lot of work, and I would be willing to do it if I thought it would be productive, but am not sure that is the right path for me at this stage.


Can anyone offer some suggestions for me on how to debug this situation?


Thanks,

Mike
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:25
Joined
Oct 29, 2018
Messages
21,468
Hi Mike. Just wondering, do you have any code behind the form? If so, what/where are they?
 

mrheffner

Registered User.
Local time
Today, 12:25
Joined
Jul 29, 2019
Messages
10
Good thought. Here is the code behind that form.


Code:
Private Sub Form_AfterUpdate()
    
    If [Qty/Blend] > 0 Then
        [Number of Blends] = [Quantity] / [Qty/Blend]
    Else
        [Number of Blends] = 0
    End If


End Sub

Private Sub Form_Current()
    
End Sub

Private Sub Qty_Blend_AfterUpdate()


    If [Qty/Blend] > 0 Then
        [Number of Blends] = [Quantity] / [Qty/Blend]
    Else
        [Number of Blends] = 0
    End If
    
    
    
End Sub

Private Sub Quantity_AfterUpdate()
    
    If [Qty/Blend] > 0 Then
        [Number of Blends] = [Quantity] / [Qty/Blend]
    Else
        [Number of Blends] = 0
    End If
    
End Sub

Private Sub Text22_AfterUpdate()
        
    If [Qty/Blend] > 0 Then
        [Number of Blends] = [Quantity] / [Qty/Blend]
    Else
        [Number of Blends] = 0
    End If
    
End Sub
 

mrheffner

Registered User.
Local time
Today, 12:25
Joined
Jul 29, 2019
Messages
10
So your question got me to look closer at the code I had behind the form, and I realized that I did not need code at "Form_AfterUpdate". So I took it out and now my form works properly. I don't understand why it was failing, but am glad it is working now.


If anyone can tell me why it was failing, I would love to know.


Thanks,
Mike
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:25
Joined
Oct 29, 2018
Messages
21,468
So your question got me to look closer at the code I had behind the form, and I realized that I did not need code at "Form_AfterUpdate". So I took it out and now my form works properly. I don't understand why it was failing, but am glad it is working now.

If anyone can tell me why it was failing, I would love to know.

Thanks,
Mike
Hi Mike. Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom