For optimal results, you may also want to update the default values of Doc and PA in the subform when the user changes the Default Doc or Default PA in the main form:
Code: Select all
Private Sub DefaultDoc_AfterUpdate()
Me.Encounters_Subform!Doc.DefaultValue = Chr(34) & Me.DefaultDoc & Chr(34)
End Sub
Private Sub DefaultPA_AfterUpdate()
Me.Encounters_Subform!PA.DefaultValue = Chr(34) & Me.DefaultPA & Chr(34)
End Sub
By the way, it'd be better to use the primary key from the Physicians, PAs, Hospitals and Hospital Unit Names tables instead of the names. For example, if a hospital is given a new name (something which occurs quite often in the country where I live), you only need to change it in the Hospitals table, and all references in forms and reports will automatically reflect the change.
If you do this, you'll have to change the Bound Column of the combo boxes from 2 (the name column) to 1 (the ID column).
Creating relationships with enforced referential integrity will ensure that the user can't create "orphan" values, for example assign a Doc to a patient that doesn't occur in the Physicians table.
See the attached version.
StrippedCrossCover.zip
You do not have the required permissions to view the files attached to this post.