I am using the following AfterUpdate code when exiting a text box named
Narrative:
Private Sub Narrative_AfterUpdate()
For Each ctl In Me.Controls
If ctl.Name = "Narrative" Then
ctl.Enabled = True
Else
If ctl.ControlType = acTextBox Then ctl.Enabled = False
End If
Next ctl
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSelectRecord
Me.Narrative.SetFocus
DoCmd.RunCommand acCmdSpelling
DoCmd.SetWarnings True
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then ctl.Enabled = True
Next ctl
End Sub
My problem is that some users are reporting that it occassionally checks
other records in the table, not just the one being viewed. I have the form
opened as acFormAdd and the Cycle = Current Record. Is there anything I can
add that will force it to do only the record being added?
|
|
0
|
|
|
|
Reply
|
Utf
|
1/13/2010 10:13:01 PM |
|
Jay,
That is an issue, so I use the one below. I added the line * If
ctlSpell.BackColor = 15400959 Then* so that any box on a form I want spell
checked I tint that color and it only checks that one. Using a button, you
can activate with...
Private Sub cmdSpellCheck_Click()
Call Spell
End Sub
.... or on your case, on the After_Update event.
'***Start of Code
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 ctlSpell.BackColor = 15400959 Then
If Len(ctlSpell) > 0 Then
With ctlSpell
.SetFocus
.SelStart = 0
.SelLength = Len(ctlSpell)
End With
DoCmd.RunCommand acCmdSpelling
End If
End If
End If
Next
DoCmd.SetWarnings True
End Function
'**End of Code
--
Gina Whipp
2010 Microsoft MVP (Access)
"I feel I have been denied critical, need to know, information!" - Tremors
II
http://www.regina-whipp.com/index_files/TipList.htm
"Jay Myhre" <JayMyhre@discussions.microsoft.com> wrote in message
news:A520F7EF-EAEB-4B3C-9F62-1200BEF510D3@microsoft.com...
>I am using the following AfterUpdate code when exiting a text box named
> Narrative:
> Private Sub Narrative_AfterUpdate()
> For Each ctl In Me.Controls
> If ctl.Name = "Narrative" Then
> ctl.Enabled = True
> Else
> If ctl.ControlType = acTextBox Then ctl.Enabled = False
> End If
> Next ctl
> DoCmd.SetWarnings False
> DoCmd.RunCommand acCmdSelectRecord
> Me.Narrative.SetFocus
> DoCmd.RunCommand acCmdSpelling
> DoCmd.SetWarnings True
>
> For Each ctl In Me.Controls
> If ctl.ControlType = acTextBox Then ctl.Enabled = True
> Next ctl
> End Sub
>
> My problem is that some users are reporting that it occassionally checks
> other records in the table, not just the one being viewed. I have the
> form
> opened as acFormAdd and the Cycle = Current Record. Is there anything I
> can
> add that will force it to do only the record being added?
|
|
0
|
|
|
|
Reply
|
Gina
|
1/14/2010 2:26:07 AM
|
|
Gina - Thanks. But won't it then spellcheck that same field in each record
or am I missing something?
What if I add something like:
Dim lngCurrentRecordID as Long
lngCurrentRecordID = Me!RecordID
If TypeOf ctlSpell Is TextBox and Me!RecordID = lngCurrentRecordID then
Would that keep it from spellchecking any record other than one currently
being viewed?
Jay
"Gina Whipp" wrote:
> Jay,
>
> That is an issue, so I use the one below. I added the line * If
> ctlSpell.BackColor = 15400959 Then* so that any box on a form I want spell
> checked I tint that color and it only checks that one. Using a button, you
> can activate with...
>
> Private Sub cmdSpellCheck_Click()
> Call Spell
> End Sub
>
> .... or on your case, on the After_Update event.
>
>
> '***Start of Code
> 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 ctlSpell.BackColor = 15400959 Then
> If Len(ctlSpell) > 0 Then
> With ctlSpell
> .SetFocus
> .SelStart = 0
> .SelLength = Len(ctlSpell)
> End With
> DoCmd.RunCommand acCmdSpelling
> End If
> End If
> End If
> Next
> DoCmd.SetWarnings True
> End Function
> '**End of Code
>
> --
> Gina Whipp
> 2010 Microsoft MVP (Access)
>
> "I feel I have been denied critical, need to know, information!" - Tremors
> II
>
> http://www.regina-whipp.com/index_files/TipList.htm
>
> "Jay Myhre" <JayMyhre@discussions.microsoft.com> wrote in message
> news:A520F7EF-EAEB-4B3C-9F62-1200BEF510D3@microsoft.com...
> >I am using the following AfterUpdate code when exiting a text box named
> > Narrative:
> > Private Sub Narrative_AfterUpdate()
> > For Each ctl In Me.Controls
> > If ctl.Name = "Narrative" Then
> > ctl.Enabled = True
> > Else
> > If ctl.ControlType = acTextBox Then ctl.Enabled = False
> > End If
> > Next ctl
> > DoCmd.SetWarnings False
> > DoCmd.RunCommand acCmdSelectRecord
> > Me.Narrative.SetFocus
> > DoCmd.RunCommand acCmdSpelling
> > DoCmd.SetWarnings True
> >
> > For Each ctl In Me.Controls
> > If ctl.ControlType = acTextBox Then ctl.Enabled = True
> > Next ctl
> > End Sub
> >
> > My problem is that some users are reporting that it occassionally checks
> > other records in the table, not just the one being viewed. I have the
> > form
> > opened as acFormAdd and the Cycle = Current Record. Is there anything I
> > can
> > add that will force it to do only the record being added?
>
>
> .
>
|
|
0
|
|
|
|
Reply
|
Utf
|
1/14/2010 3:46:01 AM
|
|
Jay,
It does not for me... It only checks the current record. Now I do use a
button but on the After_Update event of the field should work. And yes,
mine is in a continuos form. I just checked it to be sure and it stays on
the current record only. Remember you are only *toning* the field you want
spell checked.
--
Gina Whipp
2010 Microsoft MVP (Access)
"I feel I have been denied critical, need to know, information!" - Tremors
II
http://www.regina-whipp.com/index_files/TipList.htm
"Jay Myhre" <JayMyhre@discussions.microsoft.com> wrote in message
news:7C3B885D-29E8-40CD-9053-9D7AB7F3464F@microsoft.com...
> Gina - Thanks. But won't it then spellcheck that same field in each
> record
> or am I missing something?
> What if I add something like:
>
> Dim lngCurrentRecordID as Long
> lngCurrentRecordID = Me!RecordID
>
> If TypeOf ctlSpell Is TextBox and Me!RecordID = lngCurrentRecordID then
>
> Would that keep it from spellchecking any record other than one currently
> being viewed?
>
> Jay
>
> "Gina Whipp" wrote:
>
>> Jay,
>>
>> That is an issue, so I use the one below. I added the line * If
>> ctlSpell.BackColor = 15400959 Then* so that any box on a form I want
>> spell
>> checked I tint that color and it only checks that one. Using a button,
>> you
>> can activate with...
>>
>> Private Sub cmdSpellCheck_Click()
>> Call Spell
>> End Sub
>>
>> .... or on your case, on the After_Update event.
>>
>>
>> '***Start of Code
>> 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 ctlSpell.BackColor = 15400959 Then
>> If Len(ctlSpell) > 0 Then
>> With ctlSpell
>> .SetFocus
>> .SelStart = 0
>> .SelLength = Len(ctlSpell)
>> End With
>> DoCmd.RunCommand acCmdSpelling
>> End If
>> End If
>> End If
>> Next
>> DoCmd.SetWarnings True
>> End Function
>> '**End of Code
>>
>> --
>> Gina Whipp
>> 2010 Microsoft MVP (Access)
>>
>> "I feel I have been denied critical, need to know, information!" -
>> Tremors
>> II
>>
>> http://www.regina-whipp.com/index_files/TipList.htm
>>
>> "Jay Myhre" <JayMyhre@discussions.microsoft.com> wrote in message
>> news:A520F7EF-EAEB-4B3C-9F62-1200BEF510D3@microsoft.com...
>> >I am using the following AfterUpdate code when exiting a text box named
>> > Narrative:
>> > Private Sub Narrative_AfterUpdate()
>> > For Each ctl In Me.Controls
>> > If ctl.Name = "Narrative" Then
>> > ctl.Enabled = True
>> > Else
>> > If ctl.ControlType = acTextBox Then ctl.Enabled = False
>> > End If
>> > Next ctl
>> > DoCmd.SetWarnings False
>> > DoCmd.RunCommand acCmdSelectRecord
>> > Me.Narrative.SetFocus
>> > DoCmd.RunCommand acCmdSpelling
>> > DoCmd.SetWarnings True
>> >
>> > For Each ctl In Me.Controls
>> > If ctl.ControlType = acTextBox Then ctl.Enabled = True
>> > Next ctl
>> > End Sub
>> >
>> > My problem is that some users are reporting that it occassionally
>> > checks
>> > other records in the table, not just the one being viewed. I have the
>> > form
>> > opened as acFormAdd and the Cycle = Current Record. Is there anything
>> > I
>> > can
>> > add that will force it to do only the record being added?
>>
>>
>> .
>>
|
|
0
|
|
|
|
Reply
|
Gina
|
1/14/2010 4:29:16 AM
|
|
Gina,
Thanks - you have been great help and I really appeciate it!
Jay
"Gina Whipp" wrote:
> Jay,
>
> It does not for me... It only checks the current record. Now I do use a
> button but on the After_Update event of the field should work. And yes,
> mine is in a continuos form. I just checked it to be sure and it stays on
> the current record only. Remember you are only *toning* the field you want
> spell checked.
>
> --
> Gina Whipp
> 2010 Microsoft MVP (Access)
>
> "I feel I have been denied critical, need to know, information!" - Tremors
> II
>
> http://www.regina-whipp.com/index_files/TipList.htm
>
> "Jay Myhre" <JayMyhre@discussions.microsoft.com> wrote in message
> news:7C3B885D-29E8-40CD-9053-9D7AB7F3464F@microsoft.com...
> > Gina - Thanks. But won't it then spellcheck that same field in each
> > record
> > or am I missing something?
> > What if I add something like:
> >
> > Dim lngCurrentRecordID as Long
> > lngCurrentRecordID = Me!RecordID
> >
> > If TypeOf ctlSpell Is TextBox and Me!RecordID = lngCurrentRecordID then
> >
> > Would that keep it from spellchecking any record other than one currently
> > being viewed?
> >
> > Jay
> >
> > "Gina Whipp" wrote:
> >
> >> Jay,
> >>
> >> That is an issue, so I use the one below. I added the line * If
> >> ctlSpell.BackColor = 15400959 Then* so that any box on a form I want
> >> spell
> >> checked I tint that color and it only checks that one. Using a button,
> >> you
> >> can activate with...
> >>
> >> Private Sub cmdSpellCheck_Click()
> >> Call Spell
> >> End Sub
> >>
> >> .... or on your case, on the After_Update event.
> >>
> >>
> >> '***Start of Code
> >> 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 ctlSpell.BackColor = 15400959 Then
> >> If Len(ctlSpell) > 0 Then
> >> With ctlSpell
> >> .SetFocus
> >> .SelStart = 0
> >> .SelLength = Len(ctlSpell)
> >> End With
> >> DoCmd.RunCommand acCmdSpelling
> >> End If
> >> End If
> >> End If
> >> Next
> >> DoCmd.SetWarnings True
> >> End Function
> >> '**End of Code
> >>
> >> --
> >> Gina Whipp
> >> 2010 Microsoft MVP (Access)
> >>
> >> "I feel I have been denied critical, need to know, information!" -
> >> Tremors
> >> II
> >>
> >> http://www.regina-whipp.com/index_files/TipList.htm
> >>
> >> "Jay Myhre" <JayMyhre@discussions.microsoft.com> wrote in message
> >> news:A520F7EF-EAEB-4B3C-9F62-1200BEF510D3@microsoft.com...
> >> >I am using the following AfterUpdate code when exiting a text box named
> >> > Narrative:
> >> > Private Sub Narrative_AfterUpdate()
> >> > For Each ctl In Me.Controls
> >> > If ctl.Name = "Narrative" Then
> >> > ctl.Enabled = True
> >> > Else
> >> > If ctl.ControlType = acTextBox Then ctl.Enabled = False
> >> > End If
> >> > Next ctl
> >> > DoCmd.SetWarnings False
> >> > DoCmd.RunCommand acCmdSelectRecord
> >> > Me.Narrative.SetFocus
> >> > DoCmd.RunCommand acCmdSpelling
> >> > DoCmd.SetWarnings True
> >> >
> >> > For Each ctl In Me.Controls
> >> > If ctl.ControlType = acTextBox Then ctl.Enabled = True
> >> > Next ctl
> >> > End Sub
> >> >
> >> > My problem is that some users are reporting that it occassionally
> >> > checks
> >> > other records in the table, not just the one being viewed. I have the
> >> > form
> >> > opened as acFormAdd and the Cycle = Current Record. Is there anything
> >> > I
> >> > can
> >> > add that will force it to do only the record being added?
> >>
> >>
> >> .
> >>
>
>
> .
>
|
|
0
|
|
|
|
Reply
|
Utf
|
1/14/2010 8:38:02 PM
|
|
Jay,
You're welcome!
--
Gina Whipp
2010 Microsoft MVP (Access)
"I feel I have been denied critical, need to know, information!" - Tremors
II
http://www.regina-whipp.com/index_files/TipList.htm
"Jay Myhre" <JayMyhre@discussions.microsoft.com> wrote in message
news:286BE610-B9D8-4370-AD4A-ED0285F939AE@microsoft.com...
> Gina,
> Thanks - you have been great help and I really appeciate it!
> Jay
>
> "Gina Whipp" wrote:
>
>> Jay,
>>
>> It does not for me... It only checks the current record. Now I do use a
>> button but on the After_Update event of the field should work. And yes,
>> mine is in a continuos form. I just checked it to be sure and it stays
>> on
>> the current record only. Remember you are only *toning* the field you
>> want
>> spell checked.
>>
>> --
>> Gina Whipp
>> 2010 Microsoft MVP (Access)
>>
>> "I feel I have been denied critical, need to know, information!" -
>> Tremors
>> II
>>
>> http://www.regina-whipp.com/index_files/TipList.htm
>>
>> "Jay Myhre" <JayMyhre@discussions.microsoft.com> wrote in message
>> news:7C3B885D-29E8-40CD-9053-9D7AB7F3464F@microsoft.com...
>> > Gina - Thanks. But won't it then spellcheck that same field in each
>> > record
>> > or am I missing something?
>> > What if I add something like:
>> >
>> > Dim lngCurrentRecordID as Long
>> > lngCurrentRecordID = Me!RecordID
>> >
>> > If TypeOf ctlSpell Is TextBox and Me!RecordID = lngCurrentRecordID then
>> >
>> > Would that keep it from spellchecking any record other than one
>> > currently
>> > being viewed?
>> >
>> > Jay
>> >
>> > "Gina Whipp" wrote:
>> >
>> >> Jay,
>> >>
>> >> That is an issue, so I use the one below. I added the line * If
>> >> ctlSpell.BackColor = 15400959 Then* so that any box on a form I want
>> >> spell
>> >> checked I tint that color and it only checks that one. Using a
>> >> button,
>> >> you
>> >> can activate with...
>> >>
>> >> Private Sub cmdSpellCheck_Click()
>> >> Call Spell
>> >> End Sub
>> >>
>> >> .... or on your case, on the After_Update event.
>> >>
>> >>
>> >> '***Start of Code
>> >> 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 ctlSpell.BackColor = 15400959 Then
>> >> If Len(ctlSpell) > 0 Then
>> >> With ctlSpell
>> >> .SetFocus
>> >> .SelStart = 0
>> >> .SelLength = Len(ctlSpell)
>> >> End With
>> >> DoCmd.RunCommand acCmdSpelling
>> >> End If
>> >> End If
>> >> End If
>> >> Next
>> >> DoCmd.SetWarnings True
>> >> End Function
>> >> '**End of Code
>> >>
>> >> --
>> >> Gina Whipp
>> >> 2010 Microsoft MVP (Access)
>> >>
>> >> "I feel I have been denied critical, need to know, information!" -
>> >> Tremors
>> >> II
>> >>
>> >> http://www.regina-whipp.com/index_files/TipList.htm
>> >>
>> >> "Jay Myhre" <JayMyhre@discussions.microsoft.com> wrote in message
>> >> news:A520F7EF-EAEB-4B3C-9F62-1200BEF510D3@microsoft.com...
>> >> >I am using the following AfterUpdate code when exiting a text box
>> >> >named
>> >> > Narrative:
>> >> > Private Sub Narrative_AfterUpdate()
>> >> > For Each ctl In Me.Controls
>> >> > If ctl.Name = "Narrative" Then
>> >> > ctl.Enabled = True
>> >> > Else
>> >> > If ctl.ControlType = acTextBox Then ctl.Enabled = False
>> >> > End If
>> >> > Next ctl
>> >> > DoCmd.SetWarnings False
>> >> > DoCmd.RunCommand acCmdSelectRecord
>> >> > Me.Narrative.SetFocus
>> >> > DoCmd.RunCommand acCmdSpelling
>> >> > DoCmd.SetWarnings True
>> >> >
>> >> > For Each ctl In Me.Controls
>> >> > If ctl.ControlType = acTextBox Then ctl.Enabled = True
>> >> > Next ctl
>> >> > End Sub
>> >> >
>> >> > My problem is that some users are reporting that it occassionally
>> >> > checks
>> >> > other records in the table, not just the one being viewed. I have
>> >> > the
>> >> > form
>> >> > opened as acFormAdd and the Cycle = Current Record. Is there
>> >> > anything
>> >> > I
>> >> > can
>> >> > add that will force it to do only the record being added?
>> >>
>> >>
>> >> .
>> >>
>>
>>
>> .
>>
|
|
0
|
|
|
|
Reply
|
Gina
|
1/14/2010 9:59:09 PM
|
|
|
5 Replies
162 Views
(page loaded in 0.238 seconds)
Similiar Articles: How to check continuous form fields - microsoft.public.access ...... after the elseif), the code only checks the first record. ... Continuous Form enable text box on current record ... Spell Check ... record within continuous forms ... Before Update on record select - microsoft.public.access.forms ...... You want the form Current Event. It fires each time the record ... The only 2 events on the ... field ... main form to spell check 2 of the 4 fields on every record ... Main Form checkbox toggles many subform checkboxes - microsoft ...You may need to add a WHERE clause, so only related records are updated. To help you get your SQL statement, mock up a query using this table. Product Key Validity Check? - microsoft.public.office.misc ...... it and have a customer come back saying it only ... When I look at it, the spell check ... Utf 2 228 I don't ... Checking the validity of your current Windows XP ... Problem with Vista: "Run-Time error '75': Path/File ...For example, an application may store a spell check ... They only became obvious if we tried to > support ... Problems with Error 3021 - No Current Record - microsoft ... MS ACCESS :: Spell Check Current Record Only?Spell Check Current Record Only? How do you make the spell checker not cycle through all your records when you run it? As it is right now, when a user tries to spell ... Spell check just current record? - Access World ForumsSpell check just current record? Forms ... This code will check one field on the current record only when exiting the field ... Access World Forums - SpellCheck Certain FieldI have 20 Fields in a Form. I would like to spellcheck only 1 field instead of whole form. Also, how can I spellcheck only current record instead having it go through ... Microsoft Access: SpellCheck ONLY one record, one field - database ...... a way to make it check ONLY the one field of the current record. We're trying to force this as an automatic -- too many of our tutors aren't hitting that spell check ... Can you Spell check only one records "textbox" field with this commandAs a slight aside, AceMan: I'm trying to help someone on another forum who wants to Spell Check only on the current record, but wants to check all text controls on the ... 7/12/2012 10:40:57 PM
|