UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Continious Form Spell Check Row, Access 2016    
 
   
soggycashew
post Dec 2 2019, 08:18 PM
Post#1



Posts: 370
Joined: 23-April 13
From: WV, USA


Hello, I have a continuous form and in each row I have a spell check button that I want to check the three textboxes txt1, txt2 and txt3 for that row. How can I do that?
Go to the top of the page
 
soggycashew
post Dec 2 2019, 09:53 PM
Post#2



Posts: 370
Joined: 23-April 13
From: WV, USA


Here is something that works but is it possible to make it smaller with a message to say all text boxes were checked.


CODE
Private Sub cmdSpellCheckRow_Click()
If IsNull(txtJobStep) = True Then
        Exit Sub
    Else
        With Me!txtJobStep
            Me.txtJobStep.SetFocus
            If Len(.Value) > 0 Then
                DoCmd.SetWarnings False
                .SelStart = 1
                .SelLength = Len(.Value)
                DoCmd.RunCommand acCmdSpelling
                .SelLength = 0
                DoCmd.SetWarnings True
            End If
        End With
    End If
  If IsNull(txtHazards) = True Then
        Exit Sub
    Else
        With Me!txtHazards
            Me.txtHazards.SetFocus
            If Len(.Value) > 0 Then
                DoCmd.SetWarnings False
                .SelStart = 1
                .SelLength = Len(.Value)
                DoCmd.RunCommand acCmdSpelling
                .SelLength = 0
                DoCmd.SetWarnings True
            End If
        End With
    End If
If IsNull(txtHazardAvoidance) = True Then
        Exit Sub
    Else
        With Me!txtHazardAvoidance
            Me.txtHazardAvoidance.SetFocus
            If Len(.Value) > 0 Then
                DoCmd.SetWarnings False
                .SelStart = 1
                .SelLength = Len(.Value)
                DoCmd.RunCommand acCmdSpelling
                .SelLength = 0
                DoCmd.SetWarnings True
            End If
        End With
    End If
End Sub

Go to the top of the page
 
cheekybuddha
post Dec 3 2019, 05:16 AM
Post#3


UtterAccess Moderator
Posts: 11,907
Joined: 6-December 03
From: Telegraph Hill


Hi,

You can try:
CODE
Private Sub cmdSpellCheckRow_Click()
On Error Goto Exit_Here

  Dim blRet As Boolean, arrCtls As Variant, i As Integer

  arrCtls = Array("txtJobStep", "txtHazards", "txtHazardAvoidance")
  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)

Exit_Here:
  DoCmd.SetWarnings True
  If blRet Then MsgBox "Spellcheck Complete!"

End Sub


hth,

d

--------------------


Regards,

David Marten
Go to the top of the page
 
soggycashew
post Dec 3 2019, 08:56 PM
Post#4



Posts: 370
Joined: 23-April 13
From: WV, USA


Thank you so much that worked great!
Go to the top of the page
 
cheekybuddha
post Dec 3 2019, 09:07 PM
Post#5


UtterAccess Moderator
Posts: 11,907
Joined: 6-December 03
From: Telegraph Hill


yw.gif

--------------------


Regards,

David Marten
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    11th December 2019 - 09:28 AM