Private Sub ScrapSinceOK_Click()
'DoCmd.RunMacro "DialogOK"
Me.Visible = True
On Error GoTo Err_ScrapSinceOK_Click
Dim x As Variant, strObject As Long, strObject1 As Long, strObject3 As Long, strObject4 As Long, strObject5 As Long, obj As AccessObject
For Each x In InternalAuditScheduleList.ItemsSelected
strObject = InternalAuditScheduleList.Column(1, x)
Select Case strObject
Case 1 'acTable
'Set obj = CurrentData.AllTables
DoCmd.OpenTable InternalAuditScheduleList.ItemData(x), acViewNormal
Case 4 'acTable
'Set obj = CurrentData.AllTables
DoCmd.OpenTable InternalAuditScheduleList.ItemData(x), acViewNormal
Case 6 'acTable
'Set obj = CurrentData.AllTables
DoCmd.OpenTable InternalAuditScheduleList.ItemData(x), acViewNormal
Case 5 'acQuery
'Set obj = CurrentData.AllQueries
DoCmd.OpenQuery InternalAuditScheduleList.ItemData(x), acViewNormal
' DoCmd.OpenQuery obj, acViewNormal
' DoCmd.OpenQuery strObject, acViewNormal
Case -32768 'acForm
'Set obj = CurrentProject.AllForms
DoCmd.OpenForm InternalAuditScheduleList.ItemData(x), acViewNormal
Case -32764 'acReport
'Set obj = CurrentProject.AllReports
DoCmd.OpenReport InternalAuditScheduleList.ItemData(x), acViewPreview
Case -32766 'acMacro
'Set obj = CurrentProject.AllMacros
DoCmd.RunMacro InternalAuditScheduleList.ItemData(x)
'Case acModule
'Set obj = CurrentProject.AllModules
'Case acDataAccessPage
'Set obj = CurrentProject.AllDataAccessPages
End Select
Next
Exit_ScrapSinceOK_Click:
Exit Sub
Err_ScrapSinceOK_Click:
MsgBox err.Description
Resume Exit_ScrapSinceOK_Click
End Sub
|