Topic: Getting details with SQL

I couldn't get supplier names and address displayed on sale inv item form properly.


One product one supplier seems to be working OK but when multiple products associated to a supplier the it doesn't.
Please see form1 Sale Inv item 2. Try to add Product 0004, 0005 and 0006.


Product and SaleInvItem tables are linked to Supplier table.
Idea is to get supplier details displayed on frmSaleInvItem once a product is selected from cbSIitemProduct combobox.


Please see the attached sample project.

Post's attachments

Attachment icon SuppDet_OnSaleInvItemForm.zip 12.66 kb, 340 downloads since 2017-12-05 

Adam
God... please help me become the person my dog thinks I am.

2 (edited by derek 2017-12-05 19:06:57)

Re: Getting details with SQL

Hi Adam,
I suspect your script is trying to retrieve supplier details using the id of the product rather than using the id of the supplier. 
It just happened to work (for the wrong reasons) for Products 1, 2 and 3 because you have Supplier 1, 2 and 3 to (incorrectly) join on.
See attached which should fix it.
Derek.

Post's attachments

Attachment icon SuppDet_OnSaleInvItem.zip 345.95 kb, 373 downloads since 2017-12-05 

Re: Getting details with SQL

Hi Derek,


Thank you very much........................
Truly appreciated.................................

Adam
God... please help me become the person my dog thinks I am.