⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 invokeaccessreport.frm

📁 VB6数据库开发指南》的配套源程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmInvokeAccessReport 
   Caption         =   "Invoke Access Report"
   ClientHeight    =   1560
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3615
   LinkTopic       =   "Form1"
   ScaleHeight     =   1560
   ScaleWidth      =   3615
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdInvokeReport 
      Caption         =   "&Invoke Access Report"
      Height          =   735
      Left            =   240
      TabIndex        =   0
      Top             =   360
      Width           =   2055
   End
End
Attribute VB_Name = "frmInvokeAccessReport"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdInvokeReport_Click()
' Invokes an Access report in print preview mode
' Get the ActiveX object to open its database and position
' to the first record
    Dim strDbName As String
    Dim objAccess As Object
    
    On Error GoTo LoadError
    
    strDbName = App.Path
    strDbName = strDbName & "\Expense.mdb"
    Set objAccess = CreateObject("Access.Application")
    With objAccess
        .OpenCurrentDatabase FilePath:=strDbName
        .DoCmd.OpenReport ReportName:="ExpenseReport", View:=Access.acPreview
    End With
        
    ' Give up CPU control
    DoEvents
    
    Set objAccess = Nothing
    
    Exit Sub
    
LoadError:
    MsgBox Err.Description & Chr(13) & "from " & Err.Source & " -- Number: " & CStr(Err.Number)
    Unload Me

End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -