The following function will return the number of currently open forms.
'--------------------------------------------------------------------------------------- ' Procedure : CountOpenFrms ' Author : CARDA Consultants Inc. ' Website : http://www.cardaconsultants.com ' Purpose : Returns a count of the number of loaded Forms (preview or design) ' Copyright : The following may be altered and reused as you wish so long as the ' copyright notice is left unchanged (including Author, Website and ' Copyright). It may not be sold/resold or reposted on other sites. ' ' Revision History: ' Rev Date(yyyy/mm/dd) Description ' ************************************************************************************** ' 1 2009-Oct-30 Initial Release '--------------------------------------------------------------------------------------- Function CountOpenFrms() On Error GoTo Error_Handler CountOpenFrms = Application.Forms.Count Exit Function Error_Handler: MsgBox "MS Access has generated the following error" & vbCrLf & vbCrLf & "Error Number: " & _ Err.Number & vbCrLf & "Error Source: CountOpenFrms" & vbCrLf & "Error Description: " & _ Err.Description, vbCritical, "An Error has Occured!" Exit Function End Function

Thursday, June 10th, 2010, 10:30 pm | 

