Forum Discussion
Tony2021
Dec 20, 2021Steel Contributor
OpenArgs, Zero Length String Error
Hello experts, I am trying to grab the name that I type in a combo box field (cboSentTo) and also grab the Me.txtCOID. The below grabs the txtCOID but it doesnt grab what I type in the Me.cboSe...
- Dec 20, 2021
Hi,
Instead of Me.cboSentTo try this: Me!cboSentTo.Text
Since your code is in the NotInList event of the combo box, what you've typed in is not saved as its value yet, but you can already grab it with the text property.
Servus
Karl
Access News
arnel_gp
Dec 21, 2021Steel Contributor
when the Item you typed on the combo is Not In the List,
the Not On the List event is triggered and is passed the value you type to the event (as NewData).
you passed this value when you Open the Second form:
DoCmd.OpenForm "sbfrmContacts", , , , acFormAdd, acDialog, OpenArgs:=NewData & ";" & Me.txtCOID & ";" '& Me.txtProjectID & ";"
then you set the Response of the event to:
Response = acDataErrAdded
the above code will update your combobox.