Add data to 2nd column of NOT ON LIST value list?

KarenYT
3StarLounger
Posts: 212
Joined: 28 Mar 2011, 18:29
Location: Netherlands

Add data to 2nd column of NOT ON LIST value list?

Post by KarenYT »

I have 2 bound text-fields (ShipTo and ShipToName) on a form, data is ysubg value list of a query "qryShipTo" which has 2 columns: ShipTo and ShipToName.
AfterUpdate of field ShipTo, field ShipToName will automatically show on the form (no need to select).
I used ON NOT ON LIST for the "ShipTo" field, so when an entry of shipTo code is not on the value list, then manually input the ShipTo and it will be added to the query, and naturally the ShipToName will have to be input manually too but will not be added to the qryShipTo, column 1 "ShipToName".

My question is :
Is there a way to add the ShipToName after manually input on the form during the entry of the data ?

Please advise even though if that's not possible.
thanks
Karen

User avatar
Wendell
4StarLounger
Posts: 482
Joined: 24 Jan 2010, 15:02
Location: Colorado, USA

Re: Add data to 2nd column of NOT ON LIST value list?

Post by Wendell »

I'm not sure I understand your question completely, but I think you are asking if there is a way to update the query behind the combo box. I believe you should be able to do a either a refresh or a requery on the form and have all of the controls refreshed. If I've misunderstood the question, please post back with the details.
Wendell
You can't see the view if you don't climb the mountain!

User avatar
HansV
Administrator
Posts: 78465
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Add data to 2nd column of NOT ON LIST value list?

Post by HansV »

You could display an InputBox asking for the ShipToName, and use that in the SQL string to update the table, or, somewhat more user-friendly, have the On Not In List event of the ShipTo combo box display a form bound to the relevant table (or query) in which the user can enter the ShipToName.
This way, the dropdown list of the combo box will be updated with the new ShipTo and ShipToName values, and the After Update event should automatically fill the ShipToName text box.
Best wishes,
Hans

KarenYT
3StarLounger
Posts: 212
Joined: 28 Mar 2011, 18:29
Location: Netherlands

Re: Add data to 2nd column of NOT ON LIST value list?

Post by KarenYT »

OK, I almost sent the reply to Wendell to elaborate my question...and your reply block me sending....
Timing is good, Hans....Thanks for the heads up!
That makes sense to me....I think I know what to do..
Karen