Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

SubForm

unknown_2
Posts: 9
Joined: Sat Mar 31, 2012 3:04 am

SubForm

Unread post 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" ?
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: SubForm

Unread post 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
You do not have the required permissions to view the files attached to this post.
unknown_2
Posts: 9
Joined: Sat Mar 31, 2012 3:04 am

Re: SubForm

Unread post 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.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: SubForm

Unread post by admin »

uknown_2,

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

Steven
unknown_2
Posts: 9
Joined: Sat Mar 31, 2012 3:04 am

Re: SubForm

Unread post 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.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: SubForm

Unread post by admin »

Does jo_code have some trailing spaces?

Steven
unknown_2
Posts: 9
Joined: Sat Mar 31, 2012 3:04 am

Re: SubForm

Unread post 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?
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: SubForm

Unread post by admin »

Does

Code: Select all

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

Steven
unknown_2
Posts: 9
Joined: Sat Mar 31, 2012 3:04 am

Re: SubForm

Unread post 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.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: SubForm

Unread post by admin »

unknown_2,

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

I am not sure why yet.


Steven
Post Reply