spell check problem

G

Guest

I would like to spell check a database. There are two fields that the user
enters information into. In the table design I have set the default control
for these two fields to combo box and then written a select query to populate
the combo with the contents of the field already stored in the table. I have
done this because the information entered here is very repetitve and this
saves the user typing data which has already been entered.
I would like to spell check the data that the user enters preferably on the
fly but because it is a combo box its not possible. Any suggestions?
Thanks
 
A

Arvin Meyer [MVP]

Here's one I use from a standard module. Just add a command button to a form
and set it to:

=Spell()

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
--
Arvin Meyer, MCP, MVP
Free MS-Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
G

Guest

I placed the code in a module, I'm not sure if i'm calling it correctly from
my command btn. But nothing seems to happen. The command button is on the
form with the two combo boxes that need spell checking.
Thanks
Ian
 
G

Guest

I've done that but it still doesn't seem to work

Arvin Meyer said:
You'll need to change this line:

If TypeOf ctlSpell Is TextBox Then

to:

If TypeOf ctlSpell Is acComboBox Then

to do the combo boxes. I haven't tried it with combos because I use the Not
In List event and never allow anyone to type something that is different.
--
Arvin Meyer, MCP, MVP
Free MS-Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top