Forums

db read of two table columns, merge and fill dropdown

svebe 21 Dec, 2015
Hello community,

it's my first question in this forum and we can finally find a soloution together.

I want to create a formular, where you can register for a run event. I want to add an option, that a new member join or create a team.

So the main part of the registration is already working, this means you can register. The data will be saved in a table.
It's a bit tricky to explain now the next step, but I will try.

It's already possible to load the team column in the dropdown. But I the new member has not the possibility to add a new team.
For this I created a dummy entry in the table with "new team". And a hidden text box for the new teamname. If the dummy entry is selected the hidden field will be visible to add the new teamname. If the new member clicks on register, the new name will be saved in a different column in the table. That's the problem.

Now I have two options in my mind. First is, try to save the new teamname in the same column as the others, or, load both columns in the same dropdown field.
I tried many hours both options but it never worked, but I have not enough knowledge to created maybe a custom code.

Is there any description of the code available which can be used?

But the main question is, can anyone support me in this case or have a totally different solution?

Many thanks in advance for every helpful comment. I hope I could explain it correctly.
GreyHead 22 Dec, 2015
Hi svebe,

The way I would do this is to have two tables - one for members and one for teams. When you create a new team you add a new record to the 'team' table with a unique record id. Then you save that id into the member table as a team_id so that you can see which members belong to each team.

Bob
svebe 22 Dec, 2015
Hi GreyHead,

many thanks for your feedback!

You're right, that's is the correctest way. But then I cannot use easy way.
Therefore I need a lot of programming I think. I don't want, that anyone do this coding for me. That should not be the way.
But do you have maybe some code snippets to make this easier for me?
Or any coding documentation available?

I appreciate your support, many thanks.
GreyHead 22 Dec, 2015
Hi svebe,

It is both the most correct and the easiest way. And it doesn't need a lot of code, maybe a few lines to clean up the data submitted from the form depending on the way that is structured.

Bob
svebe 22 Dec, 2015
Hi Bob,

ok, sounds good. But I need surely your coding support for this. I also have no problems to buy some coffees for you.

So the first step would be to save the content of the fields in two different tables.
Don't know how to start. Can you give me some code lines for that?

Thank you!
GreyHead 22 Dec, 2015
Hi svebe,

The first thing is for you to create the form and the tables then post the form Debugger output here.

Bob
svebe 22 Dec, 2015
Hi Bob,

here are all pics of my actual configuration. If I should translate it into English please let me know.

http://1drv.ms/1V24VvF

Thank you.
svebe 06 Jan, 2016
Any news on this?

Thanks.
GreyHead 06 Jan, 2016
Hi svebe,

Nothing much - I've looked at the images but they don't tell me much about how they all fit together. What is the data you are trying to save and load - and which elements are used for the drop-down?

I'm guessing that the DB Read with the Multi setting is in the On Load event and you are using that to set the options for the dropdown?

And then the DB Save must be to save the form data? It looks as though that is being saved to the same table? But earlier we mentioned two tables?

Bob
This topic is locked and no more replies can be posted.