G
Guest
I enhance Access for the local food bank to track volunteers. Some people
have trouble spelling organization names correctly. I want to invoke the
Spellcheck DLL available within Access for just the contents of the
Organization text box, rather than the one from the menu bar which tries to
check every text box starting with the
beginning of the file. I want to check only organization names as they are
added. Other text boxes, including for organization names, are combo boxes
with tables behind them which can autofill.
I placed the code Alex Dybenko's site shows using a Form_BeforeUpdate event
procedure and I watched it step through the code. When it gets to the
SetFocus method, a message appears stating "You must save the field before
you execute the GoToControl action, the GoToControl method, or the SetFocus
method." The text box is titled "Organization."
If Not IsNull(Me!Organization) Then
If Len(Me!Organization) = 0 Then
Else
With Me.Organization
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSpelling
DoCmd.SetWarnings True
End if
End if
Prior answers by John W. Vinson asked why I typed the names at all. I had
incorrectly given the impression that "Organization" text box did not have a
table behind it. Douglas J. Steele also said Alex's code works for him too.
Alex pointed out that there is no Windows API for this, which expands my
knowledge.
Since I get an error message, it means I am doing something wrong. I changed
the code to run in an AfterUpdate event. Still no response for misspelled
words.
Please spell out what event procedure you use for this code and how you
invoke it. I can't seem to get it to work.
EarlCPhillips
Ex-Mainframer Learning Access To Make
Feeding the Hungry More Efficient
have trouble spelling organization names correctly. I want to invoke the
Spellcheck DLL available within Access for just the contents of the
Organization text box, rather than the one from the menu bar which tries to
check every text box starting with the
beginning of the file. I want to check only organization names as they are
added. Other text boxes, including for organization names, are combo boxes
with tables behind them which can autofill.
I placed the code Alex Dybenko's site shows using a Form_BeforeUpdate event
procedure and I watched it step through the code. When it gets to the
SetFocus method, a message appears stating "You must save the field before
you execute the GoToControl action, the GoToControl method, or the SetFocus
method." The text box is titled "Organization."
If Not IsNull(Me!Organization) Then
If Len(Me!Organization) = 0 Then
Else
With Me.Organization
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSpelling
DoCmd.SetWarnings True
End if
End if
Prior answers by John W. Vinson asked why I typed the names at all. I had
incorrectly given the impression that "Organization" text box did not have a
table behind it. Douglas J. Steele also said Alex's code works for him too.
Alex pointed out that there is no Windows API for this, which expands my
knowledge.
Since I get an error message, it means I am doing something wrong. I changed
the code to run in an AfterUpdate event. Still no response for misspelled
words.
Please spell out what event procedure you use for this code and how you
invoke it. I can't seem to get it to work.
EarlCPhillips
Ex-Mainframer Learning Access To Make
Feeding the Hungry More Efficient