Print Report IIF function

Seph

Member
Local time
Today, 17:53
Joined
Jul 12, 2022
Messages
72
Good day everyone,

I have a subform "InvoiceActiveList" on my main form "Invoice" form.

I have an On Click event that opens a report in Print preview based on the clicked InvoiceNumber

1670351338818.png

1670351368573.png


Is it possible to create a function that if the SalesInvoice Yes/No field is true then it opens a different report (E.g. InvoiceSalesR) and if false then InvoiceJobR?

Thank you!
 
Certainly.

DoCmd.OpenReport IIf(SalesInvoice, "InvoiceSalesR", "InvoiceJobR"), acViewPreview, , "InvoiceID=" & InvoiceID
 
Certainly.

DoCmd.OpenReport IIf(SalesInvoice, "InvoiceSalesR", "InvoiceJobR"), acViewPreview, , "InvoiceID=" & InvoiceID
You Sir/Mam are my Hero!

Thank you!
 

Users who are viewing this thread

Back
Top Bottom