dbTalk Databases Forums  

"Where Condition" in a Report !

comp.databases.ms-access comp.databases.ms-access


Discuss "Where Condition" in a Report ! in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
prakashwadhwani@gmail.com
 
Posts: n/a

Default "Where Condition" in a Report ! - 04-20-2009 , 08:16 AM






I've included a "where condition" in my report and it works !! What
I'd like to know is that if the "where condition" is NOT satisfied,
I've set the "where condition" to an "empty string". So far it is
working but I was just wondering if there are any caveats and/or if
there are any conditions under which it may fail. Just checking before
I put it into usage.

Here's the code:

Private Sub Cmd_Print_Click()
On Error GoTo Err_Cmd_Print_Click

Dim stDocName As String, where_condition As String

stDocName = "AGE_Cr"
If Me.FilterOn = True Then
where_condition = "NET_BAL <> 0"
Else
where_condition = ""
End If

With DoCmd
.OpenReport stDocName, acPreview, , where_condition
.Maximize
.RunCommand acCmdFitToWindow
End With
Reports(stDocName).ZoomControl = 0 'allows an integer from 0 = to
2500(%) ... 0 = ZoomToFit

Exit_Cmd_Print_Click:
Exit Sub

Err_Cmd_Print_Click:
MsgBox Err.Description
Resume Exit_Cmd_Print_Click

End Sub


I'd greatly appreciate ANY advice.

Thx & Best Rgds,
Prakash.

Reply With Quote
  #2  
Old   
Keith Wilby
 
Posts: n/a

Default Re: "Where Condition" in a Report ! - 04-20-2009 , 09:28 AM






<prakashwadhwani (AT) gmail (DOT) com> wrote

Quote:
I've included a "where condition" in my report and it works !! What
I'd like to know is that if the "where condition" is NOT satisfied,
I've set the "where condition" to an "empty string". So far it is
working but I was just wondering if there are any caveats and/or if
there are any conditions under which it may fail. Just checking before
I put it into usage.

Seems perfectly reasonable to me.

Keith.
www.keithwilby.co.uk



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.