This article was previously published under Q210597
Moderate: Requires basic macro, coding, and interoperability skills.
Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.
View products that this article applies to.
Sub FormOpener(FormToOpen As String)
Dim obj As AccessObject
For Each obj In CurrentProject.AllForms
If obj.Name = FormToOpen Then
DoCmd.OpenForm FormToOpen
Exit Sub
End If
Next
MsgBox FormToOpen & " does not exist in this database."
End Sub
Keywords: KB210597, kbdta, kbprogramming, kbhowto