Thanks all for your replies, the subform becomes visible so it is already open so the code DoCmd.OpenForm "myform", acNormal, , , , acDialog is not valid, how can i change this code to work when the subform becomes visible.
I have tried on GotFocus but alas no luck.
Thanks
GW