I have searched through the existing threads for a solution to my problem, but can not find an answer that works.
Here is my issue. I have a form with two subforms - the second subform is embedded in the first subform. I want to close the second subform from a command button.
Payment - main form
depsplit - subform
paymentsplit - 2nd subform embedded in the depsplit form
Here is my code:
Forms!PAYMENT![Combo11].SetFocus
DoCmd.Close acForm, "payment!depsplit!paymentsplit"
Forms!PAYMENT!depsplit!paymentsplit.Visible = False
the form does not close and I do get an error message
"you can't hide a control that has the focus"
I thought I was changing the focus to the combo11 control on the main form PAYMENT.
Please help. Thank you.
Here is my issue. I have a form with two subforms - the second subform is embedded in the first subform. I want to close the second subform from a command button.
Payment - main form
depsplit - subform
paymentsplit - 2nd subform embedded in the depsplit form
Here is my code:
Forms!PAYMENT![Combo11].SetFocus
DoCmd.Close acForm, "payment!depsplit!paymentsplit"
Forms!PAYMENT!depsplit!paymentsplit.Visible = False
the form does not close and I do get an error message
"you can't hide a control that has the focus"
I thought I was changing the focus to the combo11 control on the main form PAYMENT.
Please help. Thank you.