Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    DoCmd.RunCommand acCmdSaveRecord works okay (i.e., record seen in table) but the FindFirst command does not, so the Me.Bookmark statement bombs because of "No current Record". I don't know what's the matter with "FindFirst".

    And yes, I fixed the Function exiting path.

  2. #17
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    Kinda said that in my first post. Definitely said it in my next post
    you must be doing something in code to cause that move or record commitment.
    What "action" (code statement) will cause the record to commit
    - acCmdSaveRecord (as you show)
    - Me.Dirty = False
    - Me.SetFocus (to any object that isn't part of that record)
    - mouse or keyboard move off the record - including move from form to subform or the reverse of course.
    - DoCmd.GoToRecord (next, previous or new)
    - anything else I haven't thought of

    I'm beginning to think you skim over what's being posted for you just a wee bit too much. Like I do sometimes, but maybe more so.
    And no, not just because of this thread.

    I'd be careful requerying a form when you're in the middle of creating or updating a record. You might find yourself losing your place and reloading the form and moving to the first record. Good luck with the rest of your project!

  3. #18
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    In the initial series of posts, it didn't penetrate my feeble mind the notion of "commit", so how that might relate to code escaped me as well. All these years and that was new to me.......... playing hooky from class that day?

    Anyway, thanks so much for hanging in there with me. The code below seems to be getting the job done.

    Code:
    Private Function CommitNow(ID As Integer) As Boolean
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    '  A new family named "scrubbed" so we can commit the new record and then make it the
    '  current record.
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    
    On Error GoTo CmtErr:
    
    Me.Dirty = False
    
    Me.RecordsetClone.FindFirst "FamilyID = " & ID
    Me.AllowAdditions = False
    
    intFamID = ID
    CommitNow = True
    
    ErrExit: Exit Function
    
    CmtErr:
        MsgBox "Error attempting to save new family" & vbNewLine & _
               "Error number: " & Err.Number & vbNewLine & _
               "Error description: " & Err.Description
        CommitNow = False
        GoTo ErrExit
    
    End Function

  4. #19
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    From one geezer to another, you're welcome.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. I do not understand the steps
    By Lou_Reed in forum Access
    Replies: 4
    Last Post: 07-23-2015, 11:20 AM
  2. Open Form in Dialog mode in Add NewRecord
    By JrMontgom in forum Programming
    Replies: 1
    Last Post: 02-08-2015, 06:47 PM
  3. Trying to Understand Relationships
    By Bkper087 in forum Access
    Replies: 3
    Last Post: 10-10-2014, 12:42 AM
  4. NewRecord?
    By mwabbe in forum Access
    Replies: 17
    Last Post: 09-20-2010, 01:41 PM
  5. Help me to understand forms
    By RTaylor in forum Forms
    Replies: 0
    Last Post: 04-10-2010, 01:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums