A
Amin
please just explain what these code do on the northwind database
i have numbered them
Option Compare Database
Option Explicit
(1)
Function IsLoaded(ByVal strFormName As String) As Boolean
' Returns True if the specified form is open in Form view
' or Datasheet view.
Dim oAccessObject As AccessObject
Set oAccessObject = CurrentProject.AllForms(strFormName)
If oAccessObject.IsLoaded Then
If oAccessObject.CurrentView <> acCurViewDesign Then
IsLoaded = True
End If
End If
End Function
(2)
Sub ForEachExample()
Dim objAccess As AccessObject
For Each objAccess In CurrentProject.AllForms
Debug.Print objAccess.Name
intCtr = intCtr + 1
Next
End Sub
(3)
Sub WhatsLoaded()
Dim intCtr As
For intCtr = 0 To Forms.Count - 1
Debug.Print intCtr & " - " & Forms(intCtr).Name
Next intCtr
End Sub
(4)
Sub FormState()
Dim accForm As AccessObject
For Each accForm In CurrentProject.AllForms
Debug.Print accForm.Name & _
" Open = " & accForm.IsLoaded
Next accForm
End Sub
i have numbered them
Option Compare Database
Option Explicit
(1)
Function IsLoaded(ByVal strFormName As String) As Boolean
' Returns True if the specified form is open in Form view
' or Datasheet view.
Dim oAccessObject As AccessObject
Set oAccessObject = CurrentProject.AllForms(strFormName)
If oAccessObject.IsLoaded Then
If oAccessObject.CurrentView <> acCurViewDesign Then
IsLoaded = True
End If
End If
End Function
(2)
Sub ForEachExample()
Dim objAccess As AccessObject
For Each objAccess In CurrentProject.AllForms
Debug.Print objAccess.Name
intCtr = intCtr + 1
Next
End Sub
(3)
Sub WhatsLoaded()
Dim intCtr As
For intCtr = 0 To Forms.Count - 1
Debug.Print intCtr & " - " & Forms(intCtr).Name
Next intCtr
End Sub
(4)
Sub FormState()
Dim accForm As AccessObject
For Each accForm In CurrentProject.AllForms
Debug.Print accForm.Name & _
" Open = " & accForm.IsLoaded
Next accForm
End Sub