Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2008

Tip: Looking for answers? Try searching our database.

Spell Check

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Double A - 12 May 2008 17:10 GMT
Is it possible to spell check any text entered into a form to be sure it will
print out correctly on the report?  The field type it is entered into is text
or memo.

Thanks.
Arvin Meyer [MVP] - 12 May 2008 20:03 GMT
> Is it possible to spell check any text entered into a form to be sure it
> will
> print out correctly on the report?  The field type it is entered into is
> text
> or memo.

Try this:

Public Function Spell()
' Arvin Meyer 9/17/1998
' Adapted from code by Terry Wickenden
Dim ctlSpell As Control
Dim frm As Form
Set frm = Screen.ActiveForm
DoCmd.SetWarnings False
' Enumerate Controls collection.
For Each ctlSpell In frm.Controls
   If TypeOf ctlSpell Is TextBox Then
       If Len(ctlSpell) > 0 Then
           With ctlSpell
           .SetFocus
           .SelStart = 0
           .SelLength = Len(ctlSpell)
           End With
           DoCmd.RunCommand acCmdSpelling
       End If
       End If
Next
DoCmd.SetWarnings True
End Function
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Double A - 13 May 2008 13:44 GMT
Where exactly would I put this code?  For a particular field or code it to
the whole form?  Where in the properties window would this go?  Sorry, code
is not a strength for me.

Thanks.

> > Is it possible to spell check any text entered into a form to be sure it
> > will
[quoted text clipped - 26 lines]
> DoCmd.SetWarnings True
> End Function
Arvin Meyer [MVP] - 13 May 2008 13:48 GMT
Put it in a Standard Module and name the module something other than the
function (A function and a module cannot have the same name). Call it from a
command button on any form. A simple:

=Spell()

in the On Click property of a button will call it.
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

> Where exactly would I put this code?  For a particular field or code it to
> the whole form?  Where in the properties window would this go?  Sorry,
[quoted text clipped - 35 lines]
>> DoCmd.SetWarnings True
>> End Function
Double A - 13 May 2008 13:59 GMT
OK.  I am not familiar with "Standard Module" or where I would go to create
one.  Can I get directions for this in the help menu?

Thanks.

> Put it in a Standard Module and name the module something other than the
> function (A function and a module cannot have the same name). Call it from a
[quoted text clipped - 42 lines]
> >> DoCmd.SetWarnings True
> >> End Function
Arvin Meyer [MVP] - 14 May 2008 13:45 GMT
Sure, but if you look at your database window, you'll see Forms, Queries,
Macros, Reports, and Modules. Click on the Modules container, open a new one
and paste the code, then save. There are several kinds of Modules. Most of
the ones in the Module container are called Standard Modules.
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

> OK.  I am not familiar with "Standard Module" or where I would go to
> create
[quoted text clipped - 52 lines]
>> >> DoCmd.SetWarnings True
>> >> End Function
Double A - 15 May 2008 03:14 GMT
I created the module as you suggested and it worked great when I added a
command button to one of my forms.  My main form, however, has a subform
imbedded in it that is a datasheet view.  When I add a commend button to this
subform in design view, it is not visible when the form runs.  Is it possible
to add a command button to a datasheet view of a form?

Thanks.

> Sure, but if you look at your database window, you'll see Forms, Queries,
> Macros, Reports, and Modules. Click on the Modules container, open a new one
[quoted text clipped - 56 lines]
> >> >> DoCmd.SetWarnings True
> >> >> End Function
Arvin Meyer [MVP] - 15 May 2008 08:50 GMT
>I created the module as you suggested and it worked great when I added a
> command button to one of my forms.  My main form, however, has a subform
[quoted text clipped - 3 lines]
> possible
> to add a command button to a datasheet view of a form?

Not to a datasheet view, but you can use a continuous form and add a button
to the row. You can make a continuous form look like a datasheet (but why
would you want to?)
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Double A - 16 May 2008 02:39 GMT
I created a continuous form as you requested and added the spelling button to
the end of the row.  When I click it, it checks the spelling of my main form
but will not pick up any errors in the subform record.  Actually no matter
where I put the button, it will run through the main form fields but will not
search the subform.

Is there something I might need to add to the code to tell it to check all
associated forms.

Thanks.

> >I created the module as you suggested and it worked great when I added a
> > command button to one of my forms.  My main form, however, has a subform
[quoted text clipped - 7 lines]
> to the row. You can make a continuous form look like a datasheet (but why
> would you want to?)
Arvin Meyer [MVP] - 16 May 2008 05:34 GMT
I'd not used it in a subform before, but had in a continuous form and it
worked fine. We can make it work in a subform by removing it from a standard
module and putting it in a module in the subform. Then we need to change 1
line of code from:

Set frm = Screen.ActiveForm

to

Set frm = Me

I've tested it and it will work fine now.
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

>I created a continuous form as you requested and added the spelling button
>to
[quoted text clipped - 24 lines]
>> to the row. You can make a continuous form look like a datasheet (but why
>> would you want to?)
Double A - 16 May 2008 20:17 GMT
Thank you so much for your help with this matter.  Unfortunately I am not
very familiar with modules.  I was able to create the standard module and
have used it in a few of the forms where I have data entry.  For this
subform, I have a few questions.

You speak about putting it in a module in the subform.  Can you help me with
how to do this?  I assume you open the form and put it somewhere in
properties but I do not know where.

Also, if I keep the original standard module in place and use the =Spell()
code for "on click" in other forms, will the code in the module in the
subform interfere?

Thanks again for you assistance.  I think I am almost there.

> I'd not used it in a subform before, but had in a continuous form and it
> worked fine. We can make it work in a subform by removing it from a standard
[quoted text clipped - 36 lines]
> >> to the row. You can make a continuous form look like a datasheet (but why
> >> would you want to?)
Arvin Meyer [MVP] - 18 May 2008 02:36 GMT
In the design view of the subform, click on View code, or just use Ctrl+G to
open a code window. Make sure that the subform is selected in the Project
Explorer window on the left side of the screen. Paste your code, and make
the changes. Save.
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

> Thank you so much for your help with this matter.  Unfortunately I am not
> very familiar with modules.  I was able to create the standard module and
[quoted text clipped - 61 lines]
>> >> why
>> >> would you want to?)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.