B
Bernard
Hi all,
Have written an Outllook 2003 VBA macro to initiate a new Access 2003 Form
like this one:
---------
Sub AddAccessRecord()
Dim objAccess As Access.Application
Dim objForm As Access.Form
Set objAccess = GetObject(, "Access.Application") 'get current Database
objAccess.DoCmd.OpenForm "frmMyForm", acNormal, , , acFormAdd 'open Form
Set objForm = objAccess.Forms("frmMyForm") 'assign the local Object
variable
'Form settings code starts here
'.....
'Form settings code stops here
objForm.Visible = True 'set the access form visible
objForm.SetFocus ' with the focus
Set objForm = Nothing
Set objAccess = Nothing
End Sub
---------
This works like a charm but to go ahead with the Access form and finish the
transaction there, I've to switch (manually) from the Outllook application to
the Access one using the Taskbar or playing with the <Alt><Tab> key command.
How can this be done programmatically?
Is it possible to access the taskbar (to switch applications) using VBA code?
What I want is to make the Access Application the Active one (the one who
has the Focus) on top of the screen from my Outllook code.
an 'ObjAccess.Visible = True' statement returns an error....
Any help will be appreciated.
Have written an Outllook 2003 VBA macro to initiate a new Access 2003 Form
like this one:
---------
Sub AddAccessRecord()
Dim objAccess As Access.Application
Dim objForm As Access.Form
Set objAccess = GetObject(, "Access.Application") 'get current Database
objAccess.DoCmd.OpenForm "frmMyForm", acNormal, , , acFormAdd 'open Form
Set objForm = objAccess.Forms("frmMyForm") 'assign the local Object
variable
'Form settings code starts here
'.....
'Form settings code stops here
objForm.Visible = True 'set the access form visible
objForm.SetFocus ' with the focus
Set objForm = Nothing
Set objAccess = Nothing
End Sub
---------
This works like a charm but to go ahead with the Access form and finish the
transaction there, I've to switch (manually) from the Outllook application to
the Access one using the Taskbar or playing with the <Alt><Tab> key command.
How can this be done programmatically?
Is it possible to access the taskbar (to switch applications) using VBA code?
What I want is to make the Access Application the Active one (the one who
has the Focus) on top of the screen from my Outllook code.
an 'ObjAccess.Visible = True' statement returns an error....
Any help will be appreciated.