UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Spell Check Getting Trapped, Access 2016    
 
   
payfast8898
post Feb 26 2020, 04:55 PM
Post#1



Posts: 411
Joined: 23-April 15
From: NY


I use this code below on exit the field and have used it for years works great until i have the memo field on a tab control. I can not get out of the control by canceling or ignoring? i put a button to check all the whole form but client was hoping to not have to do that and just have it pop up after leaving that field. if i auto correct everything or add to the dictionary then works fine however there is a lot of stuff the client don't want to add so was wondering if anyone else has seen this or knows a work around thanks.

CODE
Private Sub Notes_Exit(Cancel As Integer)
On Error Resume Next
With Me!Title
   If Len(.Value) > 0 Then
    DoCmd.SetWarnings False
    .SelStart = 1
    .SelLength = Len(.Value)
    DoCmd.RunCommand acCmdSpelling
     .SelLength = 0
    DoCmd.SetWarnings True
  End If
End With
End Sub

--------------------
"When a collection of Brilliant minds, hearts and talents come together...
Expect a masterpiece"
Go to the top of the page
 
msbad1959
post Feb 27 2020, 07:42 AM
Post#2



Posts: 40
Joined: 5-June 18



This will work, just call this function from the exit of the control passing the control to it.
CODE
Function SpellCheckControl(ctl As Control)

    Dim l   As Integer
    
    l = Nz(Len(ctl), 0)
    If l <> 0 Then
        ctl.SetFocus
        ctl.SelStart = 0
        ctl.SelLength = l
        DoCmd.SetWarnings False
        DoCmd.RunCommand acCmdSpelling
        DoCmd.SetWarnings True
    End If

End Function
Go to the top of the page
 
payfast8898
post Feb 27 2020, 09:01 AM
Post#3



Posts: 411
Joined: 23-April 15
From: NY


Having the same exact issue MSbad1959 with that code, it works perfect with the other fields just not the memo field on the tab control

--------------------
"When a collection of Brilliant minds, hearts and talents come together...
Expect a masterpiece"
Go to the top of the page
 
cheekybuddha
post Feb 27 2020, 09:48 AM
Post#4


UtterAccess Moderator
Posts: 12,620
Joined: 6-December 03
From: Telegraph Hill


Is your memo text control in a subform on the tab control, or just a control placed directly on the tab?

--------------------


Regards,

David Marten
Go to the top of the page
 
payfast8898
post Feb 27 2020, 03:05 PM
Post#5



Posts: 411
Joined: 23-April 15
From: NY


just on a form not in a sub form but on the first tap page. works every where else but will not let me escape if i want to ignore or cancel, if i add to dictionary everything works fine but can't do that for everything.

--------------------
"When a collection of Brilliant minds, hearts and talents come together...
Expect a masterpiece"
Go to the top of the page
 
msbad1959
post Feb 28 2020, 07:48 AM
Post#6



Posts: 40
Joined: 5-June 18



I just tried it with the control on a tab and it worked fine for me. I'm using Access 2016
Go to the top of the page
 
payfast8898
post Feb 28 2020, 11:23 AM
Post#7



Posts: 411
Joined: 23-April 15
From: NY


what kind of text field are you using? small, large text, HTML/rich text or no. we have a large with rich text enabled, i did try a small text none rich text and still can't get out so maybe a setting somewhere on my page. here is what i use incase i'm doing it wrong on exit. =SpellCheckControl([Description]) is how i use it and it does work for the other field on the same form fine. just none in the tab form. i uploaded an example and an error message i get when i try to go into design mode on some of the forms. i don't get it with our code but with yours i do so thinking maybe i'm not using it correctly if you can show me would be great thank you.
Attached File(s)
Attached File  spelltest.zip ( 27.39K )Number of downloads: 1
Attached File  spellcheck.PNG ( 12.32K )Number of downloads: 3
 

--------------------
"When a collection of Brilliant minds, hearts and talents come together...
Expect a masterpiece"
Go to the top of the page
 
cheekybuddha
post Feb 28 2020, 11:33 AM
Post#8


UtterAccess Moderator
Posts: 12,620
Joined: 6-December 03
From: Telegraph Hill


It doesn't like it when you use an expression in the OnExit property.

Just use code.

Change the OnExit property to '[Event Procedure]'

Then in the forms module:
CODE
Private Sub description_Exit(Cancel As Integer)

  With Me
    Call SpellCheckControl(.description)
  End With
  
End Sub


You should be good to go now.

hth,

d

--------------------


Regards,

David Marten
Go to the top of the page
 
payfast8898
post Feb 28 2020, 11:38 AM
Post#9



Posts: 411
Joined: 23-April 15
From: NY


i tried that first and still can't get out, did you try the download?

--------------------
"When a collection of Brilliant minds, hearts and talents come together...
Expect a masterpiece"
Go to the top of the page
 
cheekybuddha
post Feb 28 2020, 11:39 AM
Post#10


UtterAccess Moderator
Posts: 12,620
Joined: 6-December 03
From: Telegraph Hill


Yes, that's what I tried it on.

--------------------


Regards,

David Marten
Go to the top of the page
 
payfast8898
post Feb 28 2020, 11:41 AM
Post#11



Posts: 411
Joined: 23-April 15
From: NY


try textx and see if you can get out with out hitting add to dictionary for an example

--------------------
"When a collection of Brilliant minds, hearts and talents come together...
Expect a masterpiece"
Go to the top of the page
 
cheekybuddha
post Feb 28 2020, 11:47 AM
Post#12


UtterAccess Moderator
Posts: 12,620
Joined: 6-December 03
From: Telegraph Hill


Ah yes, I also removed the ctl.SetFocus from function SpellCheckControl() since it's not neccessary when called from OnExit (you already have the focus!)

In fact, that's the problem - every time you exit you are setting the focus back. Doh! doh.gif

--------------------


Regards,

David Marten
Go to the top of the page
 
cheekybuddha
post Feb 28 2020, 11:48 AM
Post#13


UtterAccess Moderator
Posts: 12,620
Joined: 6-December 03
From: Telegraph Hill


Revised:
CODE
Function SpellCheckControl(ctl As Control)

  If Len(ctl & vbNullString) Then
    ctl.SelStart = 0
    ctl.SelLength = Len(ctl.Value)
    DoCmd.SetWarnings False
    DoCmd.RunCommand acCmdSpelling
    DoCmd.SetWarnings True
  End If

End Function

--------------------


Regards,

David Marten
Go to the top of the page
 
payfast8898
post Feb 28 2020, 11:49 AM
Post#14



Posts: 411
Joined: 23-April 15
From: NY


with the new code i can't even get out of the field on the tab control even if the words are correct?

--------------------
"When a collection of Brilliant minds, hearts and talents come together...
Expect a masterpiece"
Go to the top of the page
 
payfast8898
post Feb 28 2020, 11:51 AM
Post#15



Posts: 411
Joined: 23-April 15
From: NY


now i can get out if the words are correct but still not if they are any spelled wrong

--------------------
"When a collection of Brilliant minds, hearts and talents come together...
Expect a masterpiece"
Go to the top of the page
 
payfast8898
post Feb 28 2020, 12:01 PM
Post#16



Posts: 411
Joined: 23-April 15
From: NY


very weird and the =SpellCheckControl([Description]) works well every where else i have used it just so you know. i only had the one issue with going into design mod with the field had the focus but not on any of the other fields.

--------------------
"When a collection of Brilliant minds, hearts and talents come together...
Expect a masterpiece"
Go to the top of the page
 
cheekybuddha
post Feb 28 2020, 12:28 PM
Post#17


UtterAccess Moderator
Posts: 12,620
Joined: 6-December 03
From: Telegraph Hill


Yes, it works for me now using the expression.
Attached File(s)
Attached File  spelltest.zip ( 29.96K )Number of downloads: 2
 

--------------------


Regards,

David Marten
Go to the top of the page
 
payfast8898
post Feb 28 2020, 02:08 PM
Post#18



Posts: 411
Joined: 23-April 15
From: NY


i have tried on 4 clients and two of my employees have tried with no luck however we all have office 365 so maybe that is the issue not sure. you can also use =SpellCheckControl([Screen].[ActiveControl]) to save a lot of time works great so for everything other than a tab control works thanks for you time on that i really appreciate at it. not sure why we can't get it to work in 365 but i don't have anything else to test on that i can get to. maybe someone else will see it and test on 365 or something to see if that is it or not.

--------------------
"When a collection of Brilliant minds, hearts and talents come together...
Expect a masterpiece"
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    4th April 2020 - 06:39 AM