Lose Access focus: DoCmd.Close

  • Thread starter Thread starter Annie
  • Start date Start date
A

Annie

Hi. At the end of my code I use

DoCmd.Close acForm, "MyForm", acSaveNo

It closes out my input form just right. However, instead
of returning to Access, whatever else I have open (like
Explorer, or of course the Newsgroup) gets focus (almost
like the code used [Alt+Tab]. What's up with that and how
can I fix it?

Thanks,
Annie
 
It is possible that you have some bad code elsewhere that is causing Access
to malfunction, which sends an API call that causes the problem with your
other application. When you get back into your code window, run a debug |
Compile against your database. To see if there are any underlying issues.

Also which version of Access are you using.
 
Thanks for the reply. I'm using Access 2000. I just did
a Compact and Repair database with no problems (I admit
that occassionally, it tells me that I have an issues with
a field called "descrption" and I don't know where that
field is).

I'm not sure how to run debug/compile. I used the Debug
menu and then complied the database. It pointed out a
couple of issues NOT associated with my form. After I
fixed those issues, compile was grayed out (a good sign?).

But my forms with this type code:
DoCmd.SendObject acSendNoObject, , , , , strTo, "Email
Group"
DoCmd.Close acForm, "GroupParamEmail", acSaveNo

still make Access lose focus. Any other ideas? Thanks,
Annie
-----Original Message-----
It is possible that you have some bad code elsewhere that is causing Access
to malfunction, which sends an API call that causes the problem with your
other application. When you get back into your code window, run a debug |
Compile against your database. To see if there are any underlying issues.

Also which version of Access are you using.

Hi. At the end of my code I use

DoCmd.Close acForm, "MyForm", acSaveNo

It closes out my input form just right. However, instead
of returning to Access, whatever else I have open (like
Explorer, or of course the Newsgroup) gets focus (almost
like the code used [Alt+Tab]. What's up with that and how
can I fix it?

Thanks,
Annie


.
 
Back
Top