| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- Option Compare Database
- ' ** Access Toolbox Module **
- ' on 2017-02-28,
- ' @author: Olivier Massot
- ' V 1.0
- ' Operations on access objects: tables, queries, forms, reports, macros, modules
- Public Sub wait(d As Single)
- Dim t0 As Single
- t0 = Timer
- While Timer - t0 < d
- DoEvents
- Wend
- End Sub
- Public Sub test()
- Dim pdial As New ProgressDialog
- pdial.show "My progress bar", "Operation running...", 100, False
-
- For i = 0 To 100
- wait (0.02)
- pdial.update i, "Operation running..."
- Next i
-
- End Sub
- Public Function table_exists(tname As String) As Boolean
- Dim td As Object
-
- table_exists = False
- For Each td In CurrentDb.TableDefs
- If td.name = tname Then
- table_exists = True
- Exit Function
- End If
- Next td
-
- End Function
- Public Function query_exists(qname As String) As Boolean
- Dim rd As Object
-
- query_exists = False
- For Each rd In CurrentDb.QueryDefs
- If rd.name = nom Then
- query_exists = True
- Exit Function
- End If
- Next rd
- End Function
- Public Function form_exists(fname As String) As Boolean
- Dim frm As Object
-
- form_exists = False
- For Each frm In CurrentProject.AllForms
- If frm.name = fname Then
- form_exists = True
- GoTo fin
- End If
- Next frm
- fin:
- End Function
- Public Function report_exists(rname As String) As Boolean
- Dim rpt As Object
-
- report_exists = False
- For Each rpt In CurrentProject.AllReports
- If et.name = rname Then
- etatExiste = True
- GoTo fin
- End If
- Next rpt
- fin:
- End Function
- Public Function form_is_opened(fname As String) As Boolean
- form_is_opened = False
- If Not form_exists(fname) Then Exit Function
- form_is_opened = CurrentProject.AllForms(fname).IsLoaded
-
- End Function
- Public Function report_is_opened(rname As String) As Boolean
- report_is_opened = False
- If Not report_exists(rname) Then Exit Function
- report_is_opened = CurrentProject.AllReports(rname).IsLoaded
-
- End Function
- Public Function is_opened(objtype As Integer, objname As String) As Boolean
- is_opened = False
- IsTableOpened = SysCmd(acSysCmdGetObjectState, objtype, objname)
- End Function
|