|
-
Sep 28th, 2004, 02:58 PM
#1
Thread Starter
Hyperactive Member
Access automation, view single object
I'm currently able to open an Access MDB file's objects (reports, tables, forms, etc) from a VB app, but the full-blown MDB comes up also.
Is it possible to just open/view a single object, e.g. one report, without exposing the whole Access app?
Here's what I'm doing now
VB Code:
Dim accApp as Access.Application
:
Set accApp = New Access.Application
accApp.OpenCurrentDatabase (MDB_Path)
accApp.Visible = True
accApp.RunCommand acCmdAppMaximize
accApp.DoCmd.OpenReport "my_report", acViewPreview
Set accApp = Nothing
Feel free to make any constructive criticisms/suggestions.
Thanks, DaveBo
Last edited by DaveBo; Sep 30th, 2004 at 12:12 PM.
"The wise man doesn't know all the answers, but he knows where to find them."
VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15
-
Sep 28th, 2004, 04:10 PM
#2
Her is a quick sample:
VB Code:
Public Sub RunAccessReport(strDB As String, strReport As String, _
Optional strFilter As String = "", _
Optional strWhere As String = "")
'===================================================================
Dim AccessDB As Access.Application
Set AccessDB = New Access.Application
AccessDB.OpenCurrentDatabase strDB
AccessDB.DoCmd.OpenReport strReport, acViewPreview, strFilter, strWhere
AccessDB.Visible = True
Set AccessDB = Nothing
End Sub
'usage:
Private Sub Command1_Click()
RunAccessReport App.Path & "\nwind.mdb", "Catalog"
End Sub
-
Sep 29th, 2004, 08:35 AM
#3
Thread Starter
Hyperactive Member
Thanks RhinoBull, but that's what I'm doing now.
What I'm trying to avoid is having Access bring up the entire MDB,
i.e. I just want to see the report and not the database window, switchboard etc.
"The wise man doesn't know all the answers, but he knows where to find them."
VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15
-
Sep 29th, 2004, 02:31 PM
#4
Thread Starter
Hyperactive Member
Form object
Is it possible to declare an Access form object, e.g.
Dim accFrm As Access.Form
then open the DB as above but without setting it visible,
and then setting accFrm to a specific form in the Access DB
and then just setting accFrm.Visible = True
to just display that form?
Thanks, DaveBo
"The wise man doesn't know all the answers, but he knows where to find them."
VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15
-
Sep 29th, 2004, 03:54 PM
#5
Um I spose you tried this:
-
Sep 30th, 2004, 08:03 AM
#6
Thread Starter
Hyperactive Member
Originally posted by Dave Sell
Um I spose you tried this:
It's just the one form that I want to make visible.
i.e. keep the Access environment hidden if it has to be running at all.
"The wise man doesn't know all the answers, but he knows where to find them."
VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15
-
Sep 30th, 2004, 08:20 AM
#7
OK I see what youmean now. You want to have only a child MDI Form of a parent MDI Form be visible without the parent being visible?
I don't think Windows can handle this.
-
Sep 30th, 2004, 08:37 AM
#8
Thread Starter
Hyperactive Member
Bingo
Dave, That's what I was missing here, that Access is an MDI app.
and all those other objects are MDI child forms!
Back to the drawing board.
Can an Access form be imported into a VB app?
Thanks, DaveBo
"The wise man doesn't know all the answers, but he knows where to find them."
VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15
-
Sep 30th, 2004, 08:39 AM
#9
Ya, I would ask this as a new thread in the general VB6 programming thread and mark this one resolved.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|