Sæt Access windows i focus via API, hvordan
Jeg har følgende kode og den åbner access men vinduet bliver ikke vist???On Error Resume Next
Dim appAccess As Object
'Grab the database if open
Set appAccess = GetObject("O:\demo\db.mdb", "Access.Application")
If Err.Number <> 0 Then
'The database was not open so open it
Set appAccess = CreateObject("Access.Application")
Err.Clear
End If
'This is the macro in your database that should open the form
appAccess.DoCmd.openform ("frm"), , , , , , "test"
'Make Access visible
If Err.Number <> 0 Then
MsgBox "There was an error"
Set appAccess = Nothing
Else
appAccess.Visible = True
*SetFocusAPI appAccess.Application.hWndAccessApp
End If
Jeg mangler at declare et eller andet men hvad, når jeg fyrer koden stopper debuggeren i den linie med * ud for
Jeg kan se access kører som process
