Spell check multiple tab forms on a set of tabs

B

Brian

Hello all,

I am no where near the experts you all are, so I am asking to stand on
the shoulders of some smart people. Here is the scenario:

I have a form, on the form I have a tab control with multiple tabs,
each tab has a subform. I am trying to come up with some code that
will go to the first tab, spell check the subform, then go to the
second tab and spell check the associated form and so forth. Can
anyone help me work this out. Thank you all very much.
 
G

Guest

Hi there

Assume your Main form where you tabs are located is called "Main", the tabs
are called Page1, Page2, Page3 etc. Your Subforms are Page1_Subform,
Page2_Subform, Page3_Subform etc. Code a command button as follows:

Private Sub CmdSpelling_Click()
Page1.SetFocus ' Shows the current tab so the user knows where the spell
check is happening.
Forms!Main!Page1_Subform.setfocus ' Sets focus to the subform so that
the spell checker checks that form, not the main form.
Runcommand AcCmdSpelling

Page2.SetFocus
Forms!Main!Page2_Subform.setfocus
Runcommand AcCmdSpelling

Page3.SetFocus
Forms!Main!Page3_Subform.setfocus
Runcommand AcCmdSpelling

End Sub

Cheers
 
B

Brian

This is a great start, but I am having a bit of trouble. It sets the
focus on the first text field on subform on the tab like it is supposed
to, but the spell checker does not launch. I have mispelled words.
Also, when I am on a different tab and click the button it returns me
to the right tab, it just does launch the spell checker. Any ideas?
 
G

Guest

Ah right... multiple records...

The above code should work on one record...

To do multiple records is beyond me, i'm thinking it might be a
For...Each...Next statement - which i'm clueless to... anyone else want to
help this gentleman please?
 

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