Hi,
I have a main form, with a subform. I had a list box on the main form, from which you could select items, that would then in turn populate the subform. It worked great. But then... I decided to put the list box on a pop-up instead. Now my "DoCmd.GoToRecord , , acNewRec" statement is not working correctly, and an existing row gets overlaid on the subform instead of it going to a new line. I believe I am not referencing the subform correctly from my pop-up form.
My code, in the double-click event of the list on the pop-up, is as follows: (I changed form names for simplicity).
I have tried many iterations, including "DoCmd.GoToRecord acDataForm, "Forms!frmMain!frmSubForm", acNewRec". Sometimes I get an error that the subform is not open, even though it is.
Any suggestions?
Thanks in advance.
I have a main form, with a subform. I had a list box on the main form, from which you could select items, that would then in turn populate the subform. It worked great. But then... I decided to put the list box on a pop-up instead. Now my "DoCmd.GoToRecord , , acNewRec" statement is not working correctly, and an existing row gets overlaid on the subform instead of it going to a new line. I believe I am not referencing the subform correctly from my pop-up form.
My code, in the double-click event of the list on the pop-up, is as follows: (I changed form names for simplicity).
Code:
Forms!frmMain!fsubSub.SetFocus
DoCmd.GoToRecord , , acNewRec
Any suggestions?
Thanks in advance.