Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

"Add Record" from SubForm and populating field

fester
Posts: 23
Joined: Tue Nov 27, 2012 7:31 am

"Add Record" from SubForm and populating field

Unread post by fester »

Hi,

I have followed the steps on the youtube vid to configure the default values in an edit form Lookup.

I.E.
Subform's "Default Filter for Browse Screen" => #ClientID#
Subform's filtering works perfectly.

Click "Add Record" button...
When I set Default Value SQL for a Lookup to "select '#browse_filter#' ", I get the value=0, even though the value should be 2127827375.
I set the Default Value SQL for a Text Box to "select '#browse_filter#'" and I get out "#browse_filter#".

I have fought with this for about a day and I am at my wits end. I am obviously missing something stupid.

Help please?

Matt.
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: "Add Record" from SubForm and populating field

Unread post by massiws »

fester,
maybe something wrong in subform and/or lookup field settings.
Can you post some screenshots?

Max
fester
Posts: 23
Joined: Tue Nov 27, 2012 7:31 am

Re: "Add Record" from SubForm and populating field

Unread post by fester »

Subform
nu_subform.JPG
nu_subform.JPG (19.35 KiB) Viewed 7324 times
Lookup
nu_lookup.JPG
nu_lookup.JPG (17.43 KiB) Viewed 7324 times

The subform exists on the (Wizard) ClientTable form.
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: "Add Record" from SubForm and populating field

Unread post by massiws »

fester,
the few settings you show seems correct.
Try to check the value set in Lookup object -> Field Name field: this is the FK (in the subform QualificationsTable2) that point to PK in ClientTable table.
fester
Posts: 23
Joined: Tue Nov 27, 2012 7:31 am

Re: "Add Record" from SubForm and populating field

Unread post by fester »

The Lookup Object
nuForm1.JPG
nuForm1.JPG (60.39 KiB) Viewed 7318 times
nuForm2.JPG
nuForm2.JPG (68.8 KiB) Viewed 7318 times
Client Form
nuForm3.JPG
nuForm3.JPG (58.59 KiB) Viewed 7318 times
nuForm4.JPG
nuForm4.JPG (88.57 KiB) Viewed 7318 times
Subform
nuForm5.JPG
nuForm5.JPG (62.26 KiB) Viewed 7318 times
Anything else you would like to see?
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: "Add Record" from SubForm and populating field

Unread post by massiws »

fester,
I think the problem could be in a wrong configuration of the Lookup object: in lookup object -> All tab -> Code Field you should insert the name of a real ClientTable field (have a look at this post).
fester
Posts: 23
Joined: Tue Nov 27, 2012 7:31 am

Re: "Add Record" from SubForm and populating field

Unread post by fester »

I have the All - Field Name and the Lookup - Code Field set to the ID of the table.

The ID field is an autoincrementing int - will that possibly be the issue?
fester
Posts: 23
Joined: Tue Nov 27, 2012 7:31 am

Re: "Add Record" from SubForm and populating field

Unread post by fester »

Viewing a value from the subform i get
<input name='ClientID' id='ClientID' type='hidden' value='2127827375'>

However on the Add Record button press I get
<input name='ClientID' id='ClientID' type='hidden' value='0'>



I am missing something in bringing the FK from the subform to the popup Add Record form. I just can't work out what.
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: "Add Record" from SubForm and populating field

Unread post by massiws »

fester,
fester wrote:The ID field is an autoincrementing int - will that possibly be the issue?
have a look at this wiki.

The Field Name in the lookup object is the name of the field where the value of the lookup has to be saved; make sure that this FK is the same size and type as the PK of the lookup table.
fester
Posts: 23
Joined: Tue Nov 27, 2012 7:31 am

Re: "Add Record" from SubForm and populating field

Unread post by fester »

The ClientTable PK and the QualificationsTable FK match, and are correct from a DB point of view.

I'm stumped.

I have spoken to customer and convinced them out of this requirement. Something silly is happening and I have burnt too much time fighting with it :(
Locked