Application visible on DoCmd.FindRecord

  • Thread starter Thread starter Susan
  • Start date Start date
S

Susan

Well, I found another odd Access problem that I'm hoping
someone can help me solve.

I am using Access through a VB 6.0 program. At one
point, I load an Access form using the following code:
Dim AccessApp As Access.Application
Set AccessApp = CreateObject("Access.Application")
AccessApp.OpenCurrentDatabase <...myfrontenddb.mdb...>
AccessApp.DoCmd.OpenForm <...myformname...>
Set AccessApp = Nothing

The form works as expected and everything is great ...
until ... I reach a DoCmd.FindRecord in the code for the
form. After this statement, the Access application is
visible and won't go away until the form is closed. If
we set the application.visible property to false BEFORE
the DoCmd.FindRecord, we get the same results. If we set
the application.visible property to false AFTER the
DoCmd.FindRecord, we get a flash of the Access
application window. Either way, this is undesirable.

Any clues?

Thanks!
Susan
 
Susan said:
Well, I found another odd Access problem that I'm hoping
someone can help me solve.

I am using Access through a VB 6.0 program. At one
point, I load an Access form using the following code:
Dim AccessApp As Access.Application
Set AccessApp = CreateObject("Access.Application")
AccessApp.OpenCurrentDatabase <...myfrontenddb.mdb...>
AccessApp.DoCmd.OpenForm <...myformname...>
Set AccessApp = Nothing

The form works as expected and everything is great ...
until ... I reach a DoCmd.FindRecord in the code for the
form. After this statement, the Access application is
visible and won't go away until the form is closed. If
we set the application.visible property to false BEFORE
the DoCmd.FindRecord, we get the same results. If we set
the application.visible property to false AFTER the
DoCmd.FindRecord, we get a flash of the Access
application window. Either way, this is undesirable.

I'm don't know what's going on with the various interactions between the
form, the FindRecord method, and the Access application window, but I'll
bet you can replace the FindRecord call with DAO code that locates the
record you want directly and positions the form to it. My guess is that
would let you avoid the problem.

I'm curious -- is this form visible, even though the Access application
is not? Aside from this problem, I mean.
 
Hi Dirk!

I'm working on the DAO thing ... in the meantime, yes the
form is visible even when the Access application is not.

Susan
 
Susan said:
Hi Dirk!

I'm working on the DAO thing ... in the meantime, yes the
form is visible even when the Access application is not.

Is it popup and modal, then?
 
I'm don't know what's going on with the various interactions between the
form, the FindRecord method, and the Access application window, but I'll
bet you can replace the FindRecord call with DAO code that locates the
record you want directly and positions the form to it. My guess is that
would let you avoid the problem.

My guess is that FindRecord is a GUI (interface) command,
(i.e. a command that is in the Menu and the user interacts
with Access through it on screen) which forces the Access
application window to be visible.

There is a MSKB article about Office (which is primarily
used interactively on screen) being automated and some
side-effects may happen when Office (/Access) being
automated. I guess this is one of the side-effects.

I can't find the link at the moment but I think I got a
hard copy back home. Will post the link when I can find
it.

Cheers
Van
 
Back
Top