Gil said:
In FormASubform I have a combobox.
When the user trying to add NotInList value I open FormB.
How can I pass new data to a field in FormBSubform ?
Use the OpenForm method's OpenArgs argument.
Then use the from's Load event to set the control's value:
Me.textbox = Me.OpenArgs
Me.textbox.locked = True
The reason to lock the text box is to prevent users from
changing what was typed in the combo box. If they did
change it, you will get another not in list because what was
typed still wouldn't be in the list.
You need to set the OpenForm method's WindowMode argument to
acDialog so the NotInList procedure waits ubtil the form
closes.
Also, set the DataMode argument to acFormAdd so users can't
edit other records in the list.