Database tracks group home residents medical information. Lots of fields and subforms. So I thought it would be cool to create a Quick Access form, where a user could choose the resident and the area they want to enter data for. I created a table that contains the name of the parent form, the child form, the short name and the abbreviation of the form that I use on the parent form to identify the subforms.
For example:
ParentForm |
Subform |
Shortname |
Abbr |
ResidentInformation |
ResidentDME/SuppliesSubform |
DME/Supplies |
RDME |
And my code successfully opens the correct form:
Code:
Private Sub FormList_AfterUpdate()
Dim reqform As String
Dim abbr As String
reqform = Me.FormList.Column(1)
abbr = Me.FormList.Column(3)
DoCmd.OpenForm Me.FormList.Column(1), , , "residentid=" & Me.ResidentList.Column(0)
Forms!quickaccess.FormList.Column(3).SetFocus
End Sub
Once the form is opened I want the focus to be set to the appropriate subform (the abbr), my latest attempt is the last line in my code above. I know it's totally wrong and I get the "object required" error. I don't want to put the set focus code in the "on open" event because the forms could be opened from several different places. Any thoughts? Is this even possible?
TIA!