Topic: Issue with combobox

Hello community I am trying to add data with combo box in the database so far no success

Connecting combo box to foreign key and selecting related field brought up the list out of db, but to add more data in it I had to create whole new form I don't need that extra form to just add one item in list isn't that overkill?

so  i started searching in the forum another thing i tried is use script and add list of item to combo box that works kind of but to add new item in list i had to go through script again. Also I was not able to insert data in database. Fail lol...

What I want to accomplish is able to add new item in combo box list without leaving a form plus add that new item in database at same time.

Can it be done ??

2 (edited by derek 2017-04-29 01:04:47)

Re: Issue with combobox

Hi Kim,
The form already exists (you need to use it to populate the initial list!), so it is easiest just to add a button that calls that existing form.  Combobox data tends not to be that volatile so it's not normally something that is being added to very frequently.
But to answer your question - yes, you can add a new item to a combobox without leaving the form and have that new item added to the database (but it needs to be done by script).
If you are new to MVD, it might be more confusing than helpful to try and work out what the script is doing but, for reference (and to prove it works - LOL!) please find attached an example of one way it can be done;  click on the drop-down combobox list and select the '+' entry and then enter your new value. 
I am sure there are also other ways that some of the other users know.
Derek.

nb:  I think this example only works with MVD 3.2 and above

Post's attachments

Attachment icon kim new record 2.zip 339.97 kb, 462 downloads since 2017-04-29 

3 (edited by kim143 2017-04-29 05:11:25)

Re: Issue with combobox

wow script is very powerful thing i guess which programing language that was can you please tell me. Also if you can guide me to the some good tuts to follow and learn more about script than it will be more kind of you and thank you so much for helping me get around MVD smile

Edit

I forgot to mention that I am using 3.4b as recommended by Administrator of drivesoft

Re: Issue with combobox

kim143
You can add/edit/delete records directly in a TableGrid component. Just set properties in Editable section.

Dmitry.