Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Row Must Be Committed First Error
Monica Visser 
    
15 months ago
Hi, i cannot solve this error:
Has anybody else had the same issue?

The value cannot be added to this new row, first commit the row and then try adding the value:

Immediate window results:
Form_Current triggered
New record detected, committing changes...
Clearing fields...

DetailsPrivate Sub Form_Current()
    Debug.Print "Form_Current triggered"

    ' If this is a new record, commit the row first
    If Me.NewRecord Then
        Debug.Print "New record detected, committing changes..."
        
        ' Check if the form is dirty and save if needed
        If Me.Dirty Then
            Debug.Print "Record is dirty, saving now..."
            Me.Dirty = False
            DoEvents ' Ensure Access processes the save
        End If

        ' Force-save the record manually
        On Error Resume Next
        RunCommand acCmdSaveRecord
        DoEvents
        On Error GoTo 0
        
        ' Now clear fields safely
        If Me.NewRecord Then
            Debug.Print "Clearing fields..."
            Me.cboInventoryID = Null
            Me.txtProductCode = Null
            Me.txtProductName = Null
        End If
        
    Else
        Debug.Print "Existing record detected, syncing values..."
        
        ' Sync combo box with the Transaction Item field
        Me.cboInventoryID = Nz(Me.[Transaction Item], Null)

        ' Ensure Product Code & Name update correctly
        If Not IsNull(Me.cboInventoryID) Then
            Me.txtProductCode = Nz(Me.cboInventoryID.Column(1), "")
            Me.txtProductName = Nz(Me.cboInventoryID.Column(2), "")
        End If
    End If
End Sub

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/7/2026 8:18:18 AM. PLT: 1s