Strange Action using <ctrl>Tab in SubForm

B

bw

In a DataSheet Form, I have the following code:
Private Sub Form_AfterUpdate()
SendKeys "{F7}" 'This spell checks the SubForm
End Sub

When entering data in the SubForm, and go to the next record in the
SubForm using Tab, Enter or Arrow Keys, everything works well.

If I make a change to a field, but DO NOT press Tab, Enter or Arrow Keys
to go to the next record in the SubForm, but instead use <ctrl>Tab to go
to the next record on the MainForm, the following happens:

1. The SubForm record is indeed updated.
2. The AfterUpdate event DOES NOT get executed.
3. The mouse arrow changes to a "Cross" and has selected the MainForm
to allows the mouse to "Move" the MainForm.

Can someone explain what's going on here?
How do I make the AfterUpdate event get executed if I use <ctrl>Tab to
go to the MainForm?

Thanks,
Bernie
 
M

Marshall Barton

bw said:
In a DataSheet Form, I have the following code:
Private Sub Form_AfterUpdate()
SendKeys "{F7}" 'This spell checks the SubForm
End Sub

When entering data in the SubForm, and go to the next record in the
SubForm using Tab, Enter or Arrow Keys, everything works well.

If I make a change to a field, but DO NOT press Tab, Enter or Arrow Keys
to go to the next record in the SubForm, but instead use <ctrl>Tab to go
to the next record on the MainForm, the following happens:

1. The SubForm record is indeed updated.
2. The AfterUpdate event DOES NOT get executed.
3. The mouse arrow changes to a "Cross" and has selected the MainForm
to allows the mouse to "Move" the MainForm.

Can someone explain what's going on here?
How do I make the AfterUpdate event get executed if I use <ctrl>Tab to
go to the MainForm?

Trying to figure out what SendKeys does is a ridiculous
exercise. Don't use it!

Use DoCmd.RunCommand acCmdSpelling instead. If the text in
a text box is selected it will operate on just the text
otherwise it should(?) operate on all of the active form's
data.
 
B

bw

Marshall Barton said:
Trying to figure out what SendKeys does is a ridiculous
exercise. Don't use it!

Use DoCmd.RunCommand acCmdSpelling instead. If the text in
a text box is selected it will operate on just the text
otherwise it should(?) operate on all of the active form's
data.

That works!
Thanks Marshall
Bernie
 

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

Similar Threads


Top