Page 2 of 2

Re: Subform problem - legacy db tables

Posted: Mon Oct 19, 2020 6:19 am
by n9yty
I will have to make a copy of the DB and remove al the other tables except just the ones needed, and obfuscate the name information on those, as this is confidential data. That will take a little time.

What is the best way to send it to you?

Re: Subform problem - legacy db tables

Posted: Mon Oct 19, 2020 6:48 am
by kev1n
Yes, please upload a minimal example (containing dummy data) here.

Re: Subform problem - legacy db tables

Posted: Mon Oct 19, 2020 8:16 am
by n9yty
I really appreciate your help, this one is puzzling. I will say, the more I look at what you can do with this system, the more impressed I am. I don't know how this was never on my radar before.

Re: Subform problem - legacy db tables

Posted: Mon Oct 19, 2020 9:22 am
by kev1n
I noticed that your subform GFT_History doesn't have any objects. With Fast Forms, they are created automatically. How did you create it?

Just try adding one object manually and the error should go away.
(Objects -> Add)

Then you can add the other objects/columns.

Re: Subform problem - legacy db tables

Posted: Mon Oct 19, 2020 9:35 am
by Janusz
another point to look at - is the field names in sql tables
for example primary key in every table is defined as "rowid"
the best is to have all table field names as unique
so for example for hstf table the best would be to use:
hstf_id
hst_gift_date
hst_id_code
hst_gift_amount
etc.
if names are not unique then some unexpected issues may happen
tables.png

Re: Subform problem - legacy db tables

Posted: Mon Oct 19, 2020 9:38 am
by n9yty
I created it several different times. I didn't know if I could use the fast builder on a pre-existing table.

I just went in and added them, if this is where you mean, but it hasn't changed anything here. Did it work for you?
Screen Shot 2020-10-19 at 2.26.02 AM.png
I don't think that is the right place, but I am looking and cannot find how to open the form to get to the objects list to add a field. Sorry for being slow. I know on the main form I get to the form object editor by opening the form

I looked in the Form Editor, but I only see the "Main", "Browse" and "Custom Code" sections.

That is probably why it didn't occur to me to add them before because I can't find them. :(

Oh, I found it! :) At least one way. I went Into the global Objects editor and attached it to the form. Now that the form is displaying I can use the other approach.

THANK YOU SO MUCH. I am so sorry for taking your time on my mistake, but I hadn't found any examples online building a system like this for existing database tables in this way. Now I know.

Re: Subform problem - legacy db tables

Posted: Mon Oct 19, 2020 9:39 am
by n9yty
Janusz wrote:another point to look at - is the field names in sql tables
for example primary key in every table is defined as "rowid"
the best is to have all table field names as unique
so for example for hstf table the best would be to use:
hstf_id
hst_gift_date
hst_id_code
hst_gift_amount
etc.
if names are not unique then some unexpected issues may happen
Yes, this is legacy data. But you may be right, since they are not going to be using the legacy software any longer, once it is brought into this database I should alter the tables to change the field names to things that are unique. Thanks for bringing that up.

Re: Subform problem - legacy db tables

Posted: Mon Oct 19, 2020 9:44 am
by kev1n
Janusz wrote:another point to look at - is the field names in sql tables
for example primary key in every table is defined as "rowid"
the best is to have all table field names as unique
Janusz is right ( Also see https://wiki.nubuilder.net/nubuilderv3/ ... _Structure )
But is not imperative, you can still do a SELECT * FROM ( SELECT ..." should you encounter any issues.

Re: Subform problem - legacy db tables

Posted: Mon Oct 19, 2020 9:47 am
by n9yty
Yes, I would not design tables this way. This software dates back to the 1980's on an old UNIX platform, over the years it finally ended up on MySQL, but the schema, obviously, was never updated to anything approaching 'modern' standards. Although even then, I don't know that using the same field names in all your tables was a good idea. :)

Re: Subform problem - legacy db tables

Posted: Mon Oct 19, 2020 10:30 am
by n9yty
And thanks again for the excellent help and support! I'm working with it now and having great success in doing what I was trying to do. Now off to tackle all the related data, but being in the US central time zone, I think it is time for bed first. :) Kudos to you for getting me over the bump I was stuck behind!