473,327 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

A little help on an operator

I am passing a value from a combo box on a report initiation form to a
query which is the record source for the report.

My question is how do I pass the combo box value with an operator. I
want to pass this: <>59.

The query will run if I use 59, but will not run with <>59. Ideally, I
want to use the Like statement before the form's control reference in
the query criteria field so I can also run a "*" for all records. I
have tried everything I can think of but no success with the operator
and number criteria.

Thanks in advance.

Troy Lee
Jun 27 '08 #1
2 1179
On Tue, 10 Jun 2008 11:24:53 -0700 (PDT), tr******@comcast.net wrote:
I am passing a value from a combo box on a report initiation form to a
query which is the record source for the report.

My question is how do I pass the combo box value with an operator. I
want to pass this: <>59.

The query will run if I use 59, but will not run with <>59. Ideally, I
want to use the Like statement before the form's control reference in
the query criteria field so I can also run a "*" for all records. I
have tried everything I can think of but no success with the operator
and number criteria.

Thanks in advance.

Troy Lee
You cannot pass the <operator, but you can include it in the query
criteria.

WHERE YourTable.FieldName <>[Forms!FormName!ControlName] OR
[Forms!FormName!ControlName] Is Null

If you do not enter anything in the form control all records will be
returned.
If you enter a number value in the control, just those records will
NOT be returned.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Jun 27 '08 #2
tr******@comcast.net wrote:
I am passing a value from a combo box on a report initiation form to a
query which is the record source for the report.

My question is how do I pass the combo box value with an operator. I
want to pass this: <>59.

The query will run if I use 59, but will not run with <>59. Ideally, I
want to use the Like statement before the form's control reference in
the query criteria field so I can also run a "*" for all records. I
have tried everything I can think of but no success with the operator
and number criteria.

Thanks in advance.

Troy Lee
You might create a report with a recordsource like
Select * From Table1

There's no filter, just all the records.

Now when you open the report, you might set the filter
Me.Filter = "Status <59"
Me.FilterOn = True

If you are using a current version of Access, you can pass the argument
to the report. Docmd.OpenReport "x",,,,,"<59"
If Not IsNull(Me.OpenArgs) then
Me.Filter = "status " & Me.OpenArg
Me.FilterON = true
Endif

Denial
http://www.youtube.com/watch?v=Q4vJ8ZdmIvA
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tongu? Yumruk | last post by:
I have a little proposal about type checking in python. I'll be glad if you read and comment on it. Sorry for my bad english (I'm not a native English speaker) A Little Stricter Typing in Python...
2
by: Slash | last post by:
I often do a lot of text-mode programming in Linux and wanted to use colors in text mode, and found the ncurses library needlessly complex for small applications. So I wrote my own little header to...
8
by: Usman | last post by:
Huy everyone , Well I am not a big C++ programmer , I am just a little young kid on it tryint to learn . Actually I was given an assignment last week by my teacher which I solved ...
2
by: MyNameIsnt | last post by:
Can anyone tell me why, when I click on the buttons it register 2 characters on the display? if you use the right mousebutton it works ok, but the buttons dont flash?? it works fine without the...
3
by: Jacobo Rodriguez Villar | last post by:
Hello, I'm trying to use the find algo from the stl library, over a list of pointers: std::list<Program *> m_programs in this method: Program *GLSLManager::GetProgram(GLhandleARB id) {
2
by: brzozo2 | last post by:
Hello, this program might look abit long, but it's pretty simple and easy to follow. What it does is read from a file, outputs the contents to screen, and then writes them to a different file. It...
16
by: mdh | last post by:
Can someone look at this little program and tell me why the last line is not compiling. #include <stdio.h> int main (){ int i, j, k; i=0;
2
by: jjcp | last post by:
I would like to say thanks in advance for insight anyone can shed on this for me. Long story short from time to time I need to us C++ to take a list of file and make an index out of them in...
8
by: Andrew Savige | last post by:
I'm learning Python by reading David Beazley's "Python Essential Reference" book and writing a few toy programs. To get a feel for hashes and sorting, I set myself this little problem today (not...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.