F
FPS, Romney
Hi all,
I'm using a command button on a subform to spellcheck the text fields on the
page. This works fine on all computers (XP and 97), except for one XP
computer. I'm using a split database, with each computer having its own copy
of the FE.
I compared an XP on which the code works with the XP computer on which the
code does not work.
Both computers have Access 2002 (10.4302.4219) SP-2
Both computers have the same references enabled:
Visual Basic for Applications
Microsoft Access 10.0 Object Library
Microsoft DAO 3.6 Object Library
OLE Automation
Microsoft Visual Basic for Applications Extensibility (5.3)
A runtime error occurs on the one XP computer when the command button is
clicked. Choosing "Debug" opens the debug window, highlighting the line
which reads: "If TypeOf ctlSpell Is TextBox And ...".
[No error occurs under normal Debug/Compile of the module]
I'm wondering what could be different about these two XP computers that
would result in this problem occurring on the one, but not the other. Any
help would sure be appreciated.
Thank you.
Mark Davis
(code)
' Adaptation by Terry Wickenden of code
' from Microsoft Knowledge Base
' additional suggestions from Arvin Meyer
Dim ctlSpell As Control
DoCmd.SetWarnings False
On Error Resume Next
' Enumerate Controls collection.
For Each ctlSpell In Me.Controls
If TypeOf ctlSpell Is TextBox And ctlSpell <> "NameID" And ctlSpell <>
"Text132" Then
If Len(ctlSpell) > 0 Then
With ctlSpell
.SetFocus
.SelStart = 0
.SelLength = Len(ctlSpell)
End With
DoCmd.RunCommand acCmdSpelling
End If
End If
Next
Me!cmdSpell.SetFocus
DoCmd.SetWarnings True
I'm using a command button on a subform to spellcheck the text fields on the
page. This works fine on all computers (XP and 97), except for one XP
computer. I'm using a split database, with each computer having its own copy
of the FE.
I compared an XP on which the code works with the XP computer on which the
code does not work.
Both computers have Access 2002 (10.4302.4219) SP-2
Both computers have the same references enabled:
Visual Basic for Applications
Microsoft Access 10.0 Object Library
Microsoft DAO 3.6 Object Library
OLE Automation
Microsoft Visual Basic for Applications Extensibility (5.3)
A runtime error occurs on the one XP computer when the command button is
clicked. Choosing "Debug" opens the debug window, highlighting the line
which reads: "If TypeOf ctlSpell Is TextBox And ...".
[No error occurs under normal Debug/Compile of the module]
I'm wondering what could be different about these two XP computers that
would result in this problem occurring on the one, but not the other. Any
help would sure be appreciated.
Thank you.
Mark Davis
(code)
' Adaptation by Terry Wickenden of code
' from Microsoft Knowledge Base
' additional suggestions from Arvin Meyer
Dim ctlSpell As Control
DoCmd.SetWarnings False
On Error Resume Next
' Enumerate Controls collection.
For Each ctlSpell In Me.Controls
If TypeOf ctlSpell Is TextBox And ctlSpell <> "NameID" And ctlSpell <>
"Text132" Then
If Len(ctlSpell) > 0 Then
With ctlSpell
.SetFocus
.SelStart = 0
.SelLength = Len(ctlSpell)
End With
DoCmd.RunCommand acCmdSpelling
End If
End If
Next
Me!cmdSpell.SetFocus
DoCmd.SetWarnings True