oxicottin
Learning by pecking away....
- Local time
- Today, 16:24
- Joined
- Jun 26, 2007
- Messages
- 888
Hello, I have 3 text boxes that are memo fields and I added a button on my form to spell check all 3. For some reason it spell checks the first 2 and skips the 3rd (txtQualityIssues) one and wont check it. The spelling is correct so that's not it, what could it be? Thanks!
Code:
Private Sub cmdSpellCheckIssues_Click()
'--------------------------------------------------------------------------------------------------
'Spell checks the 3 issues memo fields one after the other
'--------------------------------------------------------------------------------------------------
Dim blRet As Boolean, arrCtls As Variant, i As Integer
arrCtls = Array("txtProductionProblems", "txtMaintenanceIssues", "txtQualityIssues")
DoCmd.SetWarnings False
For i = 0 To UBound(arrCtls) - 1
With Me(arrCtls(i))
If Len(.Value & vbNullString) > 0 Then
.SetFocus
.SelStart = 1
.SelLength = Len(.Value)
DoCmd.RunCommand acCmdSpelling
.SelLength = 0
End If
End With
Next i
blRet = (Err = 0)
End Sub