Page 1 of 2

SubForm

Posted: Mon Apr 02, 2012 4:46 am
by unknown_2
Hi, i'm new to NuBuilder & would like some advice.

Following is the simple structure of the tables involve.
Image
the relationship is 1 to many, as there can be many job descriptions involve in 1 project.

The link there is, Project called P1 is handle by manager name Alice, & the job involve in the project are SMS module & Email module.

I already created the 2 tables, & a form to view table Project.

what i want the outcome to be:
Image

Basically what i've done is just create the main form & 2 text objects to show project manager name & project ID.
Then I created another object, Subform.
Table: Job
Primary key: job_id
Foreign Key: job_code
SQL: select * from Job where Job_code = '#id#'

Now the both forms were also showing, but only main showing data & subform just blank.

is there any extra steps or object i should create in order to make the subform shows field "descriptions" ?

Re: SubForm

Posted: Mon Apr 02, 2012 8:40 am
by admin
I'm not sure what you are doing wrong.

because it worked for me...
Capture.PNG
My guess is the data you have in your tables isn't exactly what you showed here.

BTW If you plan on saving these records, don't display the ID on the Form, I think you need a "pro_code".

Steven

Re: SubForm

Posted: Tue Apr 03, 2012 6:03 am
by unknown_2
i'm not sure myself the problem.

here are the tables & data i have:
Image

here are the setting i put in the subform:
Image
*i suspect i might have key in the wrong value for "Field Name" ?

here is the result i'm getting:
Image

your advice would be deeply appreciated.

Re: SubForm

Posted: Tue Apr 03, 2012 6:40 am
by admin
uknown_2,

Do you have project_id as the primary key in the Main form?

Steven

Re: SubForm

Posted: Tue Apr 03, 2012 6:54 am
by unknown_2
admin wrote:uknown_2,

Do you have project_id as the primary key in the Main form?

Steven
yes

i even try hard-coding the output with the SQL statement on subform:
select * from job where jo_code = '14f7a6c21f084a'

still not showing anything.

Re: SubForm

Posted: Tue Apr 03, 2012 7:27 am
by admin
Does jo_code have some trailing spaces?

Steven

Re: SubForm

Posted: Tue Apr 03, 2012 8:14 am
by unknown_2
admin wrote:Does jo_code have some trailing spaces?

Steven
i've double check, nop.

quick question.
the 2 tables i've created, do i need to set anything there to show that it's linked?

Re: SubForm

Posted: Tue Apr 03, 2012 8:53 am
by admin
Does

Code: Select all

select * from job where jo_code = '14f7a6c21f084a'
give you the right result running it in phpmyadmin?

Steven

Re: SubForm

Posted: Tue Apr 03, 2012 9:36 am
by unknown_2
admin wrote:Does

Code: Select all

select * from job where jo_code = '14f7a6c21f084a'
give you the right result running it in phpmyadmin?

Steven
yeap, SQL statement is fine.

btw, when i watch the tutorial video, NuBuilder has features that will auto generate the SQL statement when create form & key in the table.
i don't see such features.

Re: SubForm

Posted: Wed Apr 04, 2012 2:31 am
by admin
unknown_2,

That feature doesn't work now that textarea's have formatted code.

I am not sure why yet.


Steven