All -
I have one box tha is a drop down with numeric values. I have a second textbox that has a percentage value. I'm trying to set a condition based on the first dropdown box that when the value changes, the second textbox will be updated with the appropriate value.
Dropdown - Textbox 'Class'
Values 0,1,2,3,4,5,6
Textbox 'Likeihood of sale'
Values 100,90,33,20,5,0,0
So when a user changes the dropdown value to say 4 then the percentage textbox value will be changed to 5%
Here is my sample code:If Me.Class = "0" Then
Me.Likelihood_of_Sale = "100"
End If
ElseIf Me.Class = "1" Then
Me.Likelihood_of_Sale = "90"
ElseIf Me.Class = "2" Then
Me.Likelihood_of_Sale = 33
ElseIf Me.Class = "3" Then
Me.Likelihood_of_Sale = 20
ElseIf Me.Class = "4" Then
Me.Likelihood_of_Sale = 0.05
ElseIf Me.Class = "5" Then
Me.Likelihood_of_Sale = 0
ElseIf Me.Class = "6" Then
Me.Likelihood_of_Sale = 0
Thanks for any help on this
-Dev1
1 1534
All -
I have one box tha is a drop down with numeric values. I have a second textbox that has a percentage value. I'm trying to set a condition based on the first dropdown box that when the value changes, the second textbox will be updated with the appropriate value.
Dropdown - Textbox 'Class'
Values 0,1,2,3,4,5,6
Textbox 'Likeihood of sale'
Values 100,90,33,20,5,0,0
So when a user changes the dropdown value to say 4 then the percentage textbox value will be changed to 5%
Here is my sample code:If Me.Class = "0" Then
Me.Likelihood_of_Sale = "100"
End If
ElseIf Me.Class = "1" Then
Me.Likelihood_of_Sale = "90"
ElseIf Me.Class = "2" Then
Me.Likelihood_of_Sale = 33
ElseIf Me.Class = "3" Then
Me.Likelihood_of_Sale = 20
ElseIf Me.Class = "4" Then
Me.Likelihood_of_Sale = 0.05
ElseIf Me.Class = "5" Then
Me.Likelihood_of_Sale = 0
ElseIf Me.Class = "6" Then
Me.Likelihood_of_Sale = 0
Thanks for any help on this
-Dev1
Assuming your Combo Box name is cboNumericValues, then place the following code in the AfterUpdate() Event of this Combo Box, namely: -
Private Sub cboNumericValues_AfterUpdate()
-
Select Case Me![cboNumericValues]
-
Case 0
-
Me![Likelihood_of_Sale] = 100
-
Case 1
-
Me![Likelihood_of_Sale] = 90
-
Case 2
-
Me![Likelihood_of_Sale] = 33
-
Case 3
-
Me![Likelihood_of_Sale] = 20
-
Case 4
-
Me![Likelihood_of_Sale] = 0.05
-
Case 5, 6
-
Me![Likelihood_of_Sale] = 0
-
Case Else
-
Me![Likelihood_of_Sale] = Null
-
End Select
-
End Sub
Sign in to post your reply or Sign up for a free account.
Similar topics
by: neblackcat |
last post by:
Would anyone like to comment on the following idea?
I was just going to offer it as a new PEP until it was suggested that
I post it here for comment & consideration against PEP 308.
I'm far...
|
by: David Winter |
last post by:
(Sorry - couldn't find a generic DocBook NG - I hope this is close
enough.)
I'm considering moving my documentation and translation business -
which is currently done in proprietary formats such...
|
by: C Gillespie |
last post by:
Dear All,
Hopefully I have a simple problem. Basically, I just want to alter some text
with JS.
Here is some of my test code:
<snip>
<script type="text/javascript">
var tmp='a';
|
by: Benjamin Niemann |
last post by:
Hello,
I've been just investigating IE conditional comments - hiding things from
non-IE/Win browsers is easy, but I wanted to know, if it's possible to hide
code from IE/Win browsers.
I found...
|
by: John Kreps |
last post by:
(acc 2002)
I've got six unbound text boxes on a subform that has a white
background. Each of those six boxes has an expression that when true,
will change its background from white to another...
|
by: John Dolinka |
last post by:
I have a project of several files with #defines to setup a conditional
compile. I would like to put these #defines in a single file and change the
conditional compile from this one file with the...
|
by: John Smith |
last post by:
After reading C# documentation the Conditional attribute seemed the way to
go, but after inspecting the IL it seems those methods are still there and I
imagine the CLR removes them. Using #if DEBUG...
|
by: paulo |
last post by:
Can anyone please tell me how the C language interprets the following
code:
#include <stdio.h>
int main(void)
{
int a = 1;
int b = 10;
int x = 3;
|
by: littlealex |
last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS!
In IE6 the text for the following page doesn't display properly - rather than being...
|
by: J Lagos |
last post by:
I want to change the backcolor of textboxes in a report depending on their
value.
I messed with this for a few hours but I'm not savvy with the syntax for
getting at controls in a report.
can...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |