if Qty Value is zero or less than

mabino79

Member
Local time
Tomorrow, 01:06
Joined
Nov 17, 2021
Messages
72
is there a way to do

if Qty Value is zero or less than, the row from the report should be deleted or hide.
 
Apply filter opening report.

DoCmd.OpenReport "reportname", , , "Qty>0"
 
Apply filter opening report.

DoCmd.OpenReport "reportname", , , "Qty>0"
where to write the code, in Report opening button or in a module
 
But why would you ever want to use a macro? Please don't answer. The question was rhetorical.
 
Now Pat, you KNOW that macros are the gateway drug of choice on the road to a full-blown VBA habit. ;)
 
@oleronesoftwares I said the question was rhetorical and didn't need a response. June's solution was perfectly adequate. I would generally do it using the method arnel recommended but I didn't offer that suggestion since June's was fine. Did you not think either of those methods was adequate? If you disagree with solutions posed by others, please feel free to comment and tell us why your solution is better. Unless I had a problem with the first solution (which I didn't ) or thought it needed additional information (which I didn't) I wouldn't have jumped in here at all. I only came in because confusing an OP with multiple "good" answers isn't actually helpful. I don't think this is a contest but maybe I missed something and there is a prize (money I hope). In which case, I missed my chance. I could have beat arnel and posted his solution ahead of him because I saw the thread before he did. But I didn't. Why confuse the issue when a useful answer had already been posted?

Sometimes the OP has trouble understanding the first workable solution. If he does, then maybe he would understand or be able to implement a second or a third more easily. but others might want to also take a deep breath and hold your fire unless further help is needed or you think there is something wrong with the original suggestion.

Cute Doc;) My problem is that I came to Access already knowing how to code and now, 25 years later, I still find the logic of macros completely mystifying. My only macros are lists of simple instructions with NO logic involved. Do this, that, and the other thing. No deviations!
 
Just to be serious for a moment, Pat, don't forget that for novices, Macros make more sense because they emulate ribbon-based actions. The fact that Access has a way to convert a lengthy Macro into VBA code just means that the Macro can be your quick-n-dirty method to get started and then come back later to clean it up. Which I must admit to having done more than once as a way to get something up fast and then fix it (via conversion) for version 2.
 

Users who are viewing this thread

Back
Top Bottom