Selasa, 29 Desember 2015

Re: [MS_AccessPros] Display picture on report for specific Consignment

 

Khalid-


You don't need any code at all.  Put the name of your field containing the path - Photo - in the Control Source of your Image control.

I see no reason why you have a GROUP BY clause in your SQL.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)



On Dec 29, 2015, at 9:06 AM, Khalid Tanweer khalidtanweerburrah@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Hi John,
As you have been always helping & guiding me for my questions and problems and providing the best
solutions. Sometime before you helped me how to view an image on a form by clicking a command button.

Now it is a new situation. I need to display an image/picture on a report. What I've tried and struggled
up to now is that only I can get is that on the Text Box: ImagePath having Control Source: Photo
I get correct data, for example to open the report through Dialog Form "Dialog Sale Invoice" and selecting
a "ConsignmentNo" say 2015-B-08 on the reports control "ImagePath" i get "D:\PCTL\BarCode\2015-B-08.Jpg",
but unable to view the picture anywhere, i have also put an Unbouond Image: ImageFrame on the report.

I put some code seeking help from Access Help and i am not sure wether they are correct i paste them below:

Private Sub Report_Current()
'On Error Resume Next
    Me![ImageFrame].Picture = Me![ImagePath]
End Sub
~~~~~~~~~~~~~
Private Sub ImagePath_AfterUpdate()
 'On Error Resume Next
    Me![ImageFrame].Picture = Me![ImagePath]
 End Sub
~~~~~~~~~~~~~~
Reports Record Source is query "SaleInvoiceSelectedConsignClients2" having sql:

SELECT SaleInvoiceSelectedConsignClients1.ConsignmentNo, SaleInvoiceSelectedConsignClients1.ClientCIN, SaleInvoiceSelectedConsignClients1.ProductNameEnglish, SaleInvoiceSelectedConsignClients1.ProductNameRussian, SaleInvoiceSelectedConsignClients1.CountOfCartonNo, SaleInvoiceSelectedConsignClients1.SumOfProductQty, [Invoice Values PakCaspian Ammended].InvoiceRate, [Invoice Values PakCaspian Ammended].ImporterID, Importer.ImporterNameEnglish, SaleInvoice.BuyerCompanyName, SaleInvoice.Buyer, BuyerInvoiceCountry.CountryOfBuyerInvoiceRus, SaleInvoice.BuyerINN, Importer.ImporterCountryRussian, SaleInvoice.Seller, Importer.SellerINN, SaleInvoice.DateOfSale, SaleInvoice.RateOfLocalCurrency, [RateOfLocalCurrency]*[InvoiceRate]/135 AS PriceOfProduct, [SumOfProductQty]*[PriceOfProduct] AS SaleValue, [Consignment Number].Photo, [Consignment Number].CustomDeclarationNo, [Consignment Number].CustomDeclarationDate
FROM Importer INNER JOIN ((((SaleInvoiceSelectedConsignClients1 INNER JOIN [Invoice Values PakCaspian Ammended] ON (SaleInvoiceSelectedConsignClients1.ProductNameEnglish = [Invoice Values PakCaspian Ammended].ProductNameEnglish) AND (SaleInvoiceSelectedConsignClients1.ConsignmentNo = [Invoice Values PakCaspian Ammended].ConsignmentNo)) INNER JOIN SaleInvoice ON (SaleInvoiceSelectedConsignClients1.ClientCIN = SaleInvoice.ClientCIN) AND (SaleInvoiceSelectedConsignClients1.ConsignmentNo = SaleInvoice.ConsignmentNo)) INNER JOIN BuyerInvoiceCountry ON SaleInvoice.CountryOfBuyerInvoiceEng = BuyerInvoiceCountry.CountryOfBuyerInvoiceEng) INNER JOIN [Consignment Number] ON ([Consignment Number].ConsignmentNo = SaleInvoice.ConsignmentNo) AND ([Consignment Number].ConsignmentNo = [Invoice Values PakCaspian Ammended].ConsignmentNo) AND (SaleInvoiceSelectedConsignClients1.ConsignmentNo = [Consignment Number].ConsignmentNo)) ON Importer.ImporterID = [Invoice Values PakCaspian Ammended].ImporterID
GROUP BY SaleInvoiceSelectedConsignClients1.ConsignmentNo, SaleInvoiceSelectedConsignClients1.ClientCIN, SaleInvoiceSelectedConsignClients1.ProductNameEnglish, SaleInvoiceSelectedConsignClients1.ProductNameRussian, SaleInvoiceSelectedConsignClients1.CountOfCartonNo, SaleInvoiceSelectedConsignClients1.SumOfProductQty, [Invoice Values PakCaspian Ammended].InvoiceRate, [Invoice Values PakCaspian Ammended].ImporterID, Importer.ImporterNameEnglish, SaleInvoice.BuyerCompanyName, SaleInvoice.Buyer, BuyerInvoiceCountry.CountryOfBuyerInvoiceRus, SaleInvoice.BuyerINN, Importer.ImporterCountryRussian, SaleInvoice.Seller, Importer.SellerINN, SaleInvoice.DateOfSale, SaleInvoice.RateOfLocalCurrency, [Consignment Number].Photo, [Consignment Number].CustomDeclarationNo, [Consignment Number].CustomDeclarationDate;
~~~~~~~~~~~~~
The picture which is required on the report would be a scanned image of Bar Code from a document for each "ConsignmentNo"
there will be a unique Bar Code image.

Please help in this matter.
Regards,
Khalid

__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

.

__,_._,___

Tidak ada komentar:

Posting Komentar