Welcome to the nuBuilder forums!

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

Browse filter woes!

Post Reply
jroyce
Posts: 3
Joined: Mon Dec 10, 2012 3:26 pm

Browse filter woes!

Unread post by jroyce »

I'm hoping someone can point me in the right direction here as I've scoured the forum and YouTube and have obviously missed something obvious here!

I have a maintenance form (customer) whose primary key is customer_id. I have a second table which holds domain names (domain) - this table has a primary key domain_id and is linked to the customer table by domain_customer_id (hope you are following this!). I have created a domain subform to browse the domains of each indivdual customer. The subform works with no browse filter specified, but I just cannot get 1) The subform to display records from domain where domain_cust_id = customer_id; 2) When I click 'Add New Record', the domain_cust_id field on the new domain record to be populated with the customer_id from the original screen.

As a previous user of Access, this doesn't seem like a big ask, so I guess therefore that I've overlooked something simple here but unfortuntely cannot now see the wood for the trees!

Any help, pointers or (polite) suggestions very gratefully received!

Many thanks!



James.
admin
Site Admin
Posts: 2788
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 4 times

Re: Browse filter woes!

Unread post by admin »

James,

Do you have dom_customer_id as one of the fields in the browse (it doesn't need to be visable)
cap.PNG
cap.PNG (16.7 KiB) Viewed 2560 times
Steven
jroyce
Posts: 3
Joined: Mon Dec 10, 2012 3:26 pm

Re: Browse filter woes!

Unread post by jroyce »

Hi Steven,

Thank you very much for your reply.

No, I didn't have domain_cust_id as a field within the browse form - I do now! I cannot seem to link the parent and browse forms though to display only data pertinent to the parent form. I believe that I have to edit the SQL within the browse form and use the #browse_filter# tag within the subform object but am coming unstuck here somewhere! Could you point me in the right direction?

Very many thanks,



James.
admin
Site Admin
Posts: 2788
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 4 times

Re: Browse filter woes!

Unread post by admin »

James,

Are your customer IDs character strings or integers?

(if the id is 60, for instance, it will display all the 60's regardless of which searchable field it might be found in)

Steven
jroyce
Posts: 3
Joined: Mon Dec 10, 2012 3:26 pm

Re: Browse filter woes!

Unread post by jroyce »

Hi Steven,

Thank you for your reply.

My ID's were all integers, but I've since changed them to utilise the NuBuilder PK functionality.

I've resolved the browse form problem now by amending the query within the subform. I can also pick up the customer ID within the 'add new' domain form. I have however run into another problem - I need to include the PK of the customer table within the customer form, otherwise I cannot pick up its value for use in the subform query (at least that's how it seems). Of course however, if I include a PK on any form, its inclusion means that the unique id is not saved when creating a new record (as we save our blank PK in preference to the autogenerated version). I don't need unique id's for any other reason than to tie together data in related tables. The solution I'm looking for here (I guess) is how to tie the browse subform to its parent via the parents PK without having to include the PK on the parent form ... or am I barking up the wrong tree?

Many thanks again,



James.
admin
Site Admin
Posts: 2788
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 4 times

Re: Browse filter woes!

Unread post by admin »

James,

Can I ask you to repost this second question, it will help the forum when looking for answers.

thanks

Steven
Post Reply