whenthegeeseinvade
Registered User.
- Local time
- Today, 17:46
- Joined
- Nov 12, 2008
- Messages
- 39
Hi all
I'm working on a listbox to list all open forms so that I can use it as a quick shortcut to access any open form.
I'm trying to use the AllForms collection and it is working to a point, but I can only access the form Name rather than it's Caption as this is not a property of the AllForms collection.
I want to present my forms as a list of their captions rather than;
frmProjects
frmDashboard
etc.
This is what I currently have;
Private Sub cmdRefreshOpenFormsList_Click()
Dim i As Integer
Me.lstOpenForms.RowSource = ""
Me.lstOpenForms.Requery
For i = 0 To CurrentProject.AllForms.Count - 1
If CurrentProject.AllForms(i).IsLoaded = True Then
Me.lstOpenForms.AddItem CurrentProject.AllForms(i).Name
Else
End If
Next i
End Sub
Ideally, I would like to use a 2 column listbox and write the form name to column 1 and the Caption to column 2. I could then set column 1 to zero width and when I click on the form's caption in column 2, it can set the focus to this form.
I'm rather stuck with how to do this and so any help would be gratefully received. There's a mince pie in it for anyone who can help!
Thank you very much,
Larry
I'm working on a listbox to list all open forms so that I can use it as a quick shortcut to access any open form.
I'm trying to use the AllForms collection and it is working to a point, but I can only access the form Name rather than it's Caption as this is not a property of the AllForms collection.
I want to present my forms as a list of their captions rather than;
frmProjects
frmDashboard
etc.
This is what I currently have;
Private Sub cmdRefreshOpenFormsList_Click()
Dim i As Integer
Me.lstOpenForms.RowSource = ""
Me.lstOpenForms.Requery
For i = 0 To CurrentProject.AllForms.Count - 1
If CurrentProject.AllForms(i).IsLoaded = True Then
Me.lstOpenForms.AddItem CurrentProject.AllForms(i).Name
Else
End If
Next i
End Sub
Ideally, I would like to use a 2 column listbox and write the form name to column 1 and the Caption to column 2. I could then set column 1 to zero width and when I click on the form's caption in column 2, it can set the focus to this form.
I'm rather stuck with how to do this and so any help would be gratefully received. There's a mince pie in it for anyone who can help!
Thank you very much,
Larry