kodiak385
is using THE INTERNET!!1
- Local time
- Today, 00:16
- Joined
- Jan 25, 2007
- Messages
- 31
Sorry if this has been posted somewhere already, but I searched all over and couldn't find it. Anyway, here goes:
I'm trying to use VB to test to see if a control's value meets given conditions, and then assign the control's BackColor a new RBG value based on what it returns. Essentially, I'm using manual coding in lieu of Access' built in conditional formatting.
What I'm currently working with is something like this:
So far, this works fine. Single values and simple >/< values don't give me any trouble. The problem I'm running into is that with subsequent conditions, I need to find whether the control's value is between two given values, and I'm not sure how structure that request. I know if it were SQL, I'd use Between x And y, but unfortunately, it's not. I know this has got to be simple, but I'm drawing blanks on how to actually do it. How do I tell VB to test whether a control is between two given values?
Sorry for such a super-noob question, but I'm extremely new to VB, and I've pretty much avoided it like the plague up until this point, hehe.
I know you can do some really powerful stuff with it, so I want to learn, but I'm just barely getting my feet wet so far. Thanks for the help.
I'm trying to use VB to test to see if a control's value meets given conditions, and then assign the control's BackColor a new RBG value based on what it returns. Essentially, I'm using manual coding in lieu of Access' built in conditional formatting.
What I'm currently working with is something like this:
Code:
Private Sub txt_FinalColor_lowscores_Click()
Me!txt_FinalColor_lowscores.BackColor = Switch(txt_FinalColor_lowscores > 5, RGB(0, 255, 0), txt_FinalColor_lowscores = 5, RGB(255, 255, 0))
End Sub
So far, this works fine. Single values and simple >/< values don't give me any trouble. The problem I'm running into is that with subsequent conditions, I need to find whether the control's value is between two given values, and I'm not sure how structure that request. I know if it were SQL, I'd use Between x And y, but unfortunately, it's not. I know this has got to be simple, but I'm drawing blanks on how to actually do it. How do I tell VB to test whether a control is between two given values?
Sorry for such a super-noob question, but I'm extremely new to VB, and I've pretty much avoided it like the plague up until this point, hehe.