Results 1 to 6 of 6
  1. #1
    Travb81 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Aug 2014
    Posts
    18

    Form - New Record - Spell Check leaves current record and moves to first record

    When I am populating a new record, and click the "Spelling" button on the toolbar, the current record moves to the First Record in the table.


    How can I prevent this?

    The recordset is initially a disconnected one. Unsure if this has anything to do with it, so I'll summarise that process:

    The form opens with DoCmd.OpenForm "frmJobDetails".

    Recordset create like this... (only the important bits pasted....)
    Code:
    Set rs = New ADODB.Recordset
    rs.Open strSQL, cn, adOpenDynamic, adLockOptimistic
    With Form_frmJobDetails.Form
            Set .Recordset = rs
            .UniqueTable = "tblJobs"
            .ResyncCommand = strResync
    End With
    DoCmd.GoToRecord acDataForm, "frmJobDetails", acNewRec

    Form_AfterInsert() updates the resync command.
    Code:
    strSQL = Replace(strSQL, "WHERE 1=1", "WHERE JobID=" & Nz([JobID], "0"))
    Me.ResyncCommand = strResync

    Any advice would be greatly appreciated!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    I've never used the spell check. Just tested. Apparently it is spell checking the entire dataset. Probably why I've never used it during data entry. Really don't see any way to modify this behavior.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Travb81 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Aug 2014
    Posts
    18
    Quote Originally Posted by June7 View Post
    I've never used the spell check. Just tested. Apparently it is spell checking the entire dataset. Probably why I've never used it during data entry. Really don't see any way to modify this behavior.
    I'm running it on the Form Close event...
    Code:
        DoCmd.SetWarnings False
        DoCmd.RunCommand acCmdSpelling
        DoCmd.SetWarnings True
    And this works perfectly when I open an existing record.

    So I guess my issue is with the new record - spell check is refreshing the recordset, and then proceeds to spell check them all.
    Maybe upon Form Insert, once the record has been committed, I should be doing something different to requery the disconnected recordset, and reattach the form recordset?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Why are you using code to set form RecordSource?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Travb81 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Aug 2014
    Posts
    18
    The data source is a MySQL type server. Access is the front end. Using linked tabled was giving extremely slow results.
    So the disconnected recordsets are the working solution.

    I’ve changed my thought process. Once a new record is inserted, I now close the form and reopen the record. The requery action that the spellcheck must use, no longer loses the new record and my problem is solved. Happy days.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    It would seem that a new record being inputted is not part of the recordset until the form is closed, or you move to another "record".

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Make last record in Form's RecordSource the current record
    By GraeagleBill in forum Programming
    Replies: 6
    Last Post: 06-27-2018, 10:43 AM
  2. Replies: 5
    Last Post: 04-13-2016, 11:23 AM
  3. Replies: 3
    Last Post: 02-06-2015, 01:18 PM
  4. Replies: 3
    Last Post: 10-19-2012, 04:30 PM
  5. Replies: 1
    Last Post: 04-25-2012, 09:33 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