Results 1 to 6 of 6
  1. #1
    lllanos is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Nov 2016
    Posts
    7

    Creating a form with a subform that has spell check that can be edited before saving but not after


    I have a form with a subform that I want the user to be able to edit while entering and be able to run spell check on, and save, then after saving, I don't want the information in the form to be edited. I have been able to either have spell check or restrict editing, but not both. I have read a lot of suggestions, but I am rather new to Access and get a little confused when writing VBA. Any help would be appreciated. Thanks.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    At The record AfterUpdate event, you can lock the form immediately so no more edits.
    me.lock=true

  3. #3
    lllanos is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Nov 2016
    Posts
    7
    Apparently I did something wrong. I entered me.lock=true as an event procedure on the form level under afterupdate but received the following error message "Compile error: Method or data member not found". With the line "Private Sub Form_AfterUpdate()" Highlighted in yellow. Should I have entered the same thing under the afterupdate on the subform?

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Not your fault...Me replaces the current Form's name...and a Form doesn't have a Lock Property!

    Try this

    Code:
    Private Sub Form_Current()
     
     If Me.NewRecord Then
       Me.AllowEdits = True
     Else
       Me.AllowEdits = False
     End If
      
    End Sub

    Assuming that you want the spell check run before Saving the Record, I don't know of any reason why this should prevent that.

    Linq ;0)>

  5. #5
    lllanos is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Nov 2016
    Posts
    7
    Thank you. That worked perfectly.

  6. #6
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Glad we could help!

    Linq ;0)>

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

Similar Threads

  1. Replies: 12
    Last Post: 01-27-2016, 12:23 PM
  2. Replies: 1
    Last Post: 05-12-2014, 07:42 AM
  3. trying to turn off spell check for sent emails
    By trevor40 in forum Programming
    Replies: 2
    Last Post: 02-13-2014, 08:05 PM
  4. Spell and grammar check
    By destroyer in forum Forms
    Replies: 1
    Last Post: 01-19-2014, 11:51 AM
  5. Code to spell out check amount?
    By spkoest in forum Access
    Replies: 4
    Last Post: 06-16-2009, 07:44 PM

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