Hi. I am trying to make controls in my subform or the subform as a whole, inactive until specific controls on my main form are filled. I've tried a number of things and am having no luck. I figured the easiest would be to use the gotfocus property of a control on my subform and if parent control is null then setfocus back to the parent control and isue a message to the user. The logic works but as soon as I open my parent form the message I'm sending my user pops up and it doesn't matter which subform control I wrap this code around either. I'm confused as to why my subform controls all seem active when I open the parent form. Is there a way to keep the subform from being active until the user manually activates it? What's the best way to keep users from entering data into a subform until they have properly filled the parent form? I am including code from my subform.
Private Sub ExpDate_GotFocus()
If IsNull(Me.Parent!TripFinish) Then
MsgBox "Fill in the Trip Detail above before entering Expense data.", , "ERROR"
parent form = frmTripDetail
parent form control = TripFinish
Subform = subfrmExpDetail
subform control = ExpDate
Key field = TripID