Caveat Number One: I don't currently have a secured app on this PC suitable
for testing this, so I'll have to leave it to someone else to address any
security-related complications that may exist.
Caveat Number Two: When someone says 'VB' I tend to assume, rightly or
wrongly, that they mean VB6 rather than VB.NET. I don't have VB6 installed
on this PC, so I tested using VBA in Excel.
Caveat Number Three: If you have to go through VB anyway, the more robust
and efficient solution would probably be to display the data in a VB form.
There's an old axiom that the weakest parts of any system are the links
between subsystems.
After all that, here's the code I tested in Excel ...
Private objAccess As Object
Public Sub AutomateAccess()
Set objAccess = CreateObject("Access.Application")
'Assumes MDB in same folder as workbook. Make sure you save the workbook
before running this.
objAccess.OpenCurrentDatabase ThisWorkbook.Path & "\test.mdb"
objAccess.Visible = True
objAccess.DoCmd.OpenForm "frmTest", , , "TestID = 2"
End Sub
--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com
The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.