Hi -
I need to create a list box with operators and I'm having difficulty figuring out how to tell access that greater than = > and less than = < and or = or and so on.
If any one has any ideas it would be greatly appreciated.
Hi -
I need to create a list box with operators and I'm having difficulty figuring out how to tell access that greater than = > and less than = < and or = or and so on.
If any one has any ideas it would be greatly appreciated.
what are you using it for? generally, this is used on a search form and the like, and 3 combos are used, whereby you have one with a value, one with the operator and one with the criteria.
Hi -
Yes thats exactly what i am using it for.
Here is the form i have setup so far:
well that's great, but what exactly IS the problem? with that many lines of criteria, you're definately going to want to name your controls with some sort of convention that is conducive to a vba loop, otherwise it'll be a mess.
btw, that looks like a large screen. is that a computer? my development machine is actually a 40" TV screen. =)
The problem is I don't know how to tell Access that "is greater than" = >, "is less than" = < and so on.
Ha my monitor is slightly smaller than yours. That was a print screen from my laptop with a 13" screen.
Were the methods posted for you yesterday at UA not working? If not, you might want to post a follow up there so they can refine their answers.
cross posters
You need to use either a select case statement of a simple if/else to check that particular dropdown to convert the "is equal to" to a "=" sign in the actual code. in a vba string, if an input string is not part of an evaluation, you can concatenate directly with the ampersand. such that:make sense?Code:dim strOp as string select case me.cboOperator case "is equal to" strop = "=" case "is less than" strop = "<" case else strop = ">" end selct sql = "SELECT * FROM TABLE WHERE " sql = sql & "[field]" & strop & me.cboCriteria currentdb.execute sql
and I didn't know you were on UA too. If I would've seen that, I would've have answered you. That's a waste of time for people who answer. I'm not a part of UA because I dislike their thread structure. it's so difficult to read anything there! Not only that, but things are so specialized that they have like 50 different forums. makes it extremely time consuming to find general info on something.
Ok thanks! I'll try that.
I have dug through several threads on several forums to try to figure this out without any luck so I figured I'd try to double my chances and by posting both places.
I have honestly have spent hours and hours trying to get this one stupid form to work properly.
Last time i tried to get help people just kept telling me to use the mutiselect combo boxes which did not work for my purposes.
Word to the wise: the best way to help yourself is to read documentation. Not saying anything bad about forums, but free advice is always just that, FREE. Best not to ever expect anything from it. Just a tip to live by, in my view anyway.