Much better explaination.
I generally do this by hiding the second form, rather than closing it. If
you open the form using the acDialog parameter of the OpenForm method, then
when you hide it, the code will continue to run. You can then refer to the
value on the second form.
1. In the first forms command button
Private Sub cmdNotInList_Click
docmd.OpenForm "formName",,,,,acDialog
me.cbo_CustomerName.requery
me.cbo_CustomerName = Forms("formName").txt_CustomerName
docmd.close acform, "formName"
End Sub
This code would open the form titled "formName". I generally remove all of
the ways to close a form other than a "Close" button in the bottom right
corner of the form. When they click on this button, I change the forms
Visible property to False, which allows the code in the main forms
cmdNotInList event to continue processing.
Since your combo now needs to be requeried so that it contains the new value
you entered, I do that, then I set the value of the combo box to that in the
2nd form. Finally, I close the second form.
--
HTH
Dale
Don''t forget to rate the post if it was helpful!
email address is invalid
Please reply to newsgroup only.