Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking for proper syntax 1

Status
Not open for further replies.

Bluejay07

Programmer
Mar 9, 2007
780
CA
Hello,

I am trying to run a COMAPI query on order entry, although I keep getting a criteria error.
Code:
OEORDD.Browse "ORDUNIQ = " & OEORDH.Fields("ORDUNIQ").Value & " AND QTYBACKORD > 0 AND LASTINVNUM <> """"", True

Could someone please provide the correct syntax for browsing the data without a blank lastinvnum field.

Thanks.

If at first you don't succeed, then sky diving wasn't meant for you!
 
Try
LASTINVNUM > """"
it's never going to be less than "".
 
Thanks ettienne but with 4 quotation marks, the statement is incorrect and with five I still get a criteria error. Why would you suggest greater than an empty string compared to not equal to an empty string?

If at first you don't succeed, then sky diving wasn't meant for you!
 
The problem still exists but I was doing too many things at once. The statement should actually be:
Code:
OEORDH.Browse "COMPLETE < 3 AND LASTINVNUM <> """"", True

If at first you don't succeed, then sky diving wasn't meant for you!
 
Ok, so the following works:
Code:
LASTINVNUM > """""

I've never heard of comparing a string to greater than nothing but it does seem to work. I guess that is my learned lesson for the day. Thank you.

If at first you don't succeed, then sky diving wasn't meant for you!
 
Sometimes it's easier on the brain to write your query with an extra space, like this:
Code:
OEORDH.Browse "COMPLETE < 3 AND LASTINVNUM <> """" ", True
 
Thanks for that suggestion as well DjangMan. I'll have to remember that.

If at first you don't succeed, then sky diving wasn't meant for you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top