Print Report from Form's ComboBox with Macro Where Condition (1 Viewer)

irsmalik

Registered User.
Local time
Today, 23:39
Joined
Jan 28, 2015
Messages
87
I am using Option Group on a Form for a series of Reports Preview…. One of the Option is a:
ComboBox on Form with 3 CompanyNames (Greenlet, Suncrop, Sungro)...
I want to run a Macro for Preview of Reports….
If comboBox select Greenlet Only Greenlet Report Print preview
If comboBox select Suncrop Only Suncrop Report Print preview
If comboBox select Sungro Only Sungro Report Print preview

I need help how to create Macro with Condition of Specific Company name printing
I tried it in Macro Where Condition:
[CompanyName] = Forms![Dealers Report]![cboMyCompany]
But No Result….

Thanks
Irsmalik
 

Attachments

  • Testing.accdb
    668 KB · Views: 76

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:39
Joined
May 7, 2009
Messages
16,881
i add code to the 2nd Option button (Select company in chart).
select a company and click on Chart button.
see the code on the form.
 

Attachments

  • Testing.accdb
    656 KB · Views: 92

irsmalik

Registered User.
Local time
Today, 23:39
Joined
Jan 28, 2015
Messages
87
Dear Mr arnelgp

Sir.... Thanks so much.... this is what I want.....​

Really thankful to you for helping.....​

irsmalik

 

irsmalik

Registered User.
Local time
Today, 23:39
Joined
Jan 28, 2015
Messages
87
Dear arnelgp
I want to print Latest OrderDate on Report. I made a query qLastDate.... and got 23-May-22... was last date of entry.
Now I made a Text Field and use =[qLastDate]![LastDate] at ControlSource of Report.
but it is giving Error.....

Plz guide how to print this Last Date on my report.
 

irsmalik

Registered User.
Local time
Today, 23:39
Joined
Jan 28, 2015
Messages
87
This Last Date will be printed on various Reports in Header ....
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:39
Joined
May 7, 2009
Messages
16,881
can you use DLookup() function:
use this As ControlSource:

=DLookup("LastDate", "qLastDate")
 

irsmalik

Registered User.
Local time
Today, 23:39
Joined
Jan 28, 2015
Messages
87
Dear Sir arnelgp
Sorry to disturb again.
My Chart's data consist on Only One Page but is is printing more than One page.... On all the pages, Data / Bars and their figures are Same... How can I restrict printing Only One Page... ?

Thanks in advance Sir.... I hope you won't mind... I am a learner... and want to learn from you.
irsmalik
 

Attachments

  • Testing.accdb
    648 KB · Views: 48

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:39
Joined
May 7, 2009
Messages
16,881
dont add RecordSource to the report.
 

Attachments

  • Testing (2).accdb
    712 KB · Views: 47

irsmalik

Registered User.
Local time
Today, 23:39
Joined
Jan 28, 2015
Messages
87
Sir.... Thank So Much..........
You Are Great........& very kind to me....
irsmalik
 

irsmalik

Registered User.
Local time
Today, 23:39
Joined
Jan 28, 2015
Messages
87
Sir... Arnelgp...
Do we need to change in Report properties.... ? to get only one print ...?
irsmalik
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:39
Joined
May 7, 2009
Messages
16,881
open the report in design view.
on the Property->Data->Record Source = Blank (i already remove it).
 

irsmalik

Registered User.
Local time
Today, 23:39
Joined
Jan 28, 2015
Messages
87
Dear Sir arnelgp
There is some problem in Chart view.... When select Company Combo from Dealers Report.. & run Chart Button.. A Dialog box appear for " Enter Parameter Value", "Company Name"
if I cancel it.... then Chart shows its Data.... Only One Page.... Any Solution Plz.
1655789970917.png




Thanks
irsmalik
 

irsmalik

Registered User.
Local time
Today, 23:39
Joined
Jan 28, 2015
Messages
87
Further, there is SubReport containing Grand Total of That Company, or Region, or Territory, or Dealers Total Business. This is Master Link and Child Link with RecordSource....
If we Delete RecordSource, there is No Link and SubReport does not work.
irsmalik
 

irsmalik

Registered User.
Local time
Today, 23:39
Joined
Jan 28, 2015
Messages
87
Dear Sir @arnelgp

Sir... please your attention require for above mentioned problem.

irsmalik
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:39
Joined
May 7, 2009
Messages
16,881
i don't think you need subform for it. see the attached on post#9 or yet post your db
so i will understand better what you mean.
 

irsmalik

Registered User.
Local time
Today, 23:39
Joined
Jan 28, 2015
Messages
87
Sir arnelgp
Mostly I have complete as per your instruction.... But this portion is not clear to me
I select Company Name and then Select its Region Name..... Chart and its Data is correct and OK... Even its Grand Total at Report Footer is OK....
In Report Header I want to Show the Region Name... but it is not showing.... Only Region ID is showing....
Here is attachment for you....
Thanks
irsmalik
 

Attachments

  • Testing (3).accdb
    664 KB · Views: 26

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:39
Joined
May 7, 2009
Messages
16,881
check the Region in your report.
 

Attachments

  • Testing (3).accdb
    672 KB · Views: 37

irsmalik

Registered User.
Local time
Today, 23:39
Joined
Jan 28, 2015
Messages
87

sir arnelgp

Please accept my thanks..... apparently these small tricks but I am un-aware of it....
Thank so much sir....
irsmalik
 

irsmalik

Registered User.
Local time
Today, 23:39
Joined
Jan 28, 2015
Messages
87

sir @arnelgp

If Report has No Data, there is a NoData Message....
If Chart Report has No Data..... this NoData Message Does Not Work....
Is there any way to Display NoData Message in Chart Report.....
Thanks
irsmalik
 

Users who are viewing this thread

Top Bottom