I'm designing an Access 2000 database to keep track of tasks relating to nursing. In order to organize the numerous nursing logs, I am using subforms (called "subNursingLog" on one master form. I would like to use a pull-down combo box (named "cboLog") to allow the nursing staff to select which log subform they want to view, but I'm having some trouble. Ideally, the combo box should be populated from entire list of forms in the database, based off of the prefix "LOG". For instance, a form named "LOG - Medical Appointments" would be added to the list. When the nurse selects that item, it should dynamically change the unbounded subform to the selected form. Here is some pseudo-code to illustrate:
Private Sub Form_Load()
Dim i as Integer
For i = 1 to Forms.Count
If Left(Forms(i-1).Name="LOG") Then
Private Sub cboLog_BeforeUpdate(Cancel As Integer)
Me.subNursingLog.SourceObject = cboLog.Value
Me.subNursingLog.LinkChildFields = "[Client ID]"
Me.subNursingLog.LinkMasterFields = "[Client ID]"
The main problem I'm having with the first subroutine is that the collection Forms.Count only contains the current, loaded forms - not all forms in the Access database. How would I modify this to cycle through all forms?
Because I haven't solved the first problem, I haven't debugged the second subroutine. However, if anyone notices any glaring problems, please let me know. Thanks in advance.