B
blankman
Hello, I'm new to the world of vba and I'm trying to write a boolean function
that that returns true if the form exist or false if it doesn't. Here's what
I got so far, I got it from another programer off of this site.
Public Function FormExists(strFormName As String) As Boolean
Dim fExists As Boolean
Dim db As DAO.Database
Dim intI As Integer
Set db = CurrentDb()
Do Until intI = db.Containers("AllForms").Documents.Count - 1 Or fExists
If db.Containers("AllForms").Documents(intI).Name = strFormName Then
fExists = True
Else
intI = intI + 1
End If
Loop
FormExists = fExists
Set db = Nothing
End Function
that that returns true if the form exist or false if it doesn't. Here's what
I got so far, I got it from another programer off of this site.
Public Function FormExists(strFormName As String) As Boolean
Dim fExists As Boolean
Dim db As DAO.Database
Dim intI As Integer
Set db = CurrentDb()
Do Until intI = db.Containers("AllForms").Documents.Count - 1 Or fExists
If db.Containers("AllForms").Documents(intI).Name = strFormName Then
fExists = True
Else
intI = intI + 1
End If
Loop
FormExists = fExists
Set db = Nothing
End Function