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

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 05:47
Joined
May 7, 2009
Messages
19,229
see macro35 so i added On Error.
now in design view of DealersRegion report , check the Open event on how to put Msgbox when there is no data.
 

Attachments

  • Testing (3).accdb
    712 KB · Views: 79

irsmalik

Registered User.
Local time
Tomorrow, 01:47
Joined
Jan 28, 2015
Messages
88

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
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 05:47
Joined
May 7, 2009
Messages
19,229
the db i uploaded was the latest i have.
did you check it first?
 

irsmalik

Registered User.
Local time
Tomorrow, 01:47
Joined
Jan 28, 2015
Messages
88
Here is the message when try to run the database... I am using Access 2007

1660737825825.png
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 05:47
Joined
May 7, 2009
Messages
19,229
ooh, i will have to install office 2007 first...
 

irsmalik

Registered User.
Local time
Tomorrow, 01:47
Joined
Jan 28, 2015
Messages
88
OK Sir... Thanks I got it.....
But each time we have to modify the Query Name.... Can we make a Standard for all Reports ?
irsmalik
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 05:47
Joined
May 7, 2009
Messages
19,229
you don't modify the query name
see macro, i add code.
also added code on the Open event of the report.
 

Attachments

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

irsmalik

Registered User.
Local time
Tomorrow, 01:47
Joined
Jan 28, 2015
Messages
88
Sir... Arnelgp
this Message is OK
1660804831916.png


Can we prevent from this Message.... how to Switch Off this Message.... Plz guide
1660804848014.png

thanks
irsmalik
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 05:47
Joined
May 7, 2009
Messages
19,229
did you see the Macro35?
i added OnError macro, put the same to your macro.
 

irsmalik

Registered User.
Local time
Tomorrow, 01:47
Joined
Jan 28, 2015
Messages
88
Yes... now I checked.... working with Macro ....it is working good... Thank You Sir....

I am trying to use Event Procedure ..... please check below line.... where I am making Mistake.
***
Private Sub Report_Open(Cancel As Integer)
Cancel = (DCount("1", "Sales by CategoryGLTa") = 0)

DoCmd.SetWarnings False

If Not Cancel Then
With DoCmd
.SelectObject acForm, "CategoryWise"
.Minimize
End With
Else
MsgBox "No data Found for this Category in Greenlet"
End If
End Sub
********************
irsmalik
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 05:47
Joined
May 7, 2009
Messages
19,229
Docmd.SetWarnings only applicable only for Action Queries.
 

irsmalik

Registered User.
Local time
Tomorrow, 01:47
Joined
Jan 28, 2015
Messages
88
Sir... please check above Code, where to Put
DoCmd.SetWarnings
as this code is not working and both messages are appearing.
irsmalik
 

irsmalik

Registered User.
Local time
Tomorrow, 01:47
Joined
Jan 28, 2015
Messages
88
Sir... Arnelgp
I Retrieve a group of fields by using DLookup....
It is ProductName, PackSize, UnitPrice, StockInHand..... etc

=DLookUp("[UnitPrice]","Products","[ProductID] =" & NZ([Forms]![DataEntryForm]![cboProduct],0))

How can I Edit UnitPirce....? in some case, plz guide.
irsmalik
 

Users who are viewing this thread

Top Bottom