473,714 Members | 2,169 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Populate text box with option value

26 New Member
Hi guys,

I have a problem with an option group and a two corresponding text boxes. When the user chooses an option value i want the text boxes to populate with text dependent on the choice made.

I have written an AfterUpdate procedure on the frame to try and assign the text to the value of the text box, but for some reason it does nothing...

Here is the code:

Private Sub Frame0_AfterUpd ate()
If Frame0.Value = 1 Then
Typeofsharpinju ry.Value = "Intact skin visibly contaminated with blood or any body substance"
Risklevel.Value = "Non-parenteral exposure"
ElseIf Frame0.Value = 2 Then
Typeofsharpinju ry.Value = "Intraderma l (superficial) injury with a needle considered NOT to be contaminated with blood or body substance"
Risklevel.Value = "Doubtful exposure (Low-risk)"
ElseIf Frame0.Value = 3 Then
Typeofsharpinju ry.Value = "Superficia l wound not associated with visible bleeding, caused by an instrument cosidered NOT to be contaminated with blood or a body substance"
Risklevel.Value = "Doubtful exposure (Low-risk)"
ElseIf Frame0.Value = 4 Then
Typeofsharpinju ry.Value = "Prior wound or skin lesion contaminated with a body substance other than blood e.g. urine"
Risklevel.Value = "Doubtful exposure (Low risk)"
ElseIf Frame0.Value = 5 Then
Typeofsharpinju ry.Value = "Mucous membrane or conjunctival contact with a body fluid other than blood"
Risklevel.Value = "Doubtful exposure (Low-risk)"
ElseIf Frame0.Value = 6 Then
Typeofsharpinju ry.Value = "Intraderma l (superficial) injury with a needle contaminated with blood or body subtance"
Risklevel.Value = "Possible exposure (Medium-risk)"
ElseIf Frame0.Value = 7 Then
Typeofsharpinju ry.Value = "A wound NOT associated with visible bleeding, produced by an instrument contaminated with blood or body substance"
Risklevel.Value = "Possible exposure (Medium-risk)"
ElseIf Frame0.Value = 8 Then
Typeofsharpinju ry.Value = "Prior wound or skin lesion contaminated with blood or body substance"
Risklevel.Value = "Possible exposure (Medium-risk)"
ElseIf Frame0.Value = 9 Then
Typeofsharpinju ry.Value = "Mucous membrane or conjunctival contact with blood or body substance"
Risklevel.Value = "Possible exposure (Medium-risk)"
ElseIf Frame0.Value = 10 Then
Typeofsharpinju ry.Value = "Skin penetrating injury with a needle contaminated with blood or body substance"
Risklevel.Value = "Definite exposure (High-risk)"
ElseIf Frame0.Value = 11 Then
Typeofsharpinju ry.Value = "Injection of blood/body substance <1ml"
Risklevel.Value = "Definite exposure (High-risk)"
ElseIf Frame0.Value = 12 Then
Typeofsharpinju ry.Value = "Laceration or similar wound which caused bleeding, and is produced by an instrument that is visibly contaminated with blood or body substance"
Risklevel.Value = "Definite exposure (High-risk)"
ElseIf Frame0.Value = 13 Then
Typeofsharpinju ry.Value = "In laboratory settings, any direct inoculation with HIV tissue or material likely to contain HIV, HBV or HCV not included above."
Risklevel.Value = "Definite exposure (High-risk)"
ElseIf Frame0.Value = 14 Then
Typeofsharpinju ry.Value = "Transfusio n of blood"
Risklevel.Value = "Massive exposure (High-risk)"
ElseIf Frame0.Value = 15 Then
Typeofsharpinju ry.Value = "Injection of large amount of blood/body substance >1ml"
Risklevel.Value = "Massive exposure (High-risk)"
ElseIf Frame0.Value = 16 Then
Typeofsharpinju ry.Value = "Parenteral exposure to laboratory specimens containing high titre of virus"
Risklevel.Value = "Massive exposure (High-risk)"
End If
End Sub

Thanks in advance guys.

Chris
Sep 13 '07 #1
1 2330
MMcCarthy
14,534 Recognized Expert Moderator MVP
Try this ...

Expand|Select|Wrap|Line Numbers
  1. Private Sub Frame0_AfterUpdate()
  2.  
  3.    SELECT CASE Frame0
  4.  
  5.    Case 1
  6.       Me.Typeofsharpinjury.Value = "Intact skin visibly contaminated with blood or any body substance"
  7.       Me.Risklevel.Value = "Non-parenteral exposure"
  8.    Case 2
  9.       Me.Typeofsharpinjury.Value = "Intradermal (superficial) injury with a needle considered NOT to be contaminated with blood or body substance"
  10.       Me.Risklevel.Value = "Doubtful exposure (Low-risk)"
  11.    Case 3
  12.       Me.Typeofsharpinjury.Value = "Superficial wound not associated with visible bleeding, caused by an instrument cosidered NOT to be contaminated with blood or a body substance"
  13.       Me.Risklevel.Value = "Doubtful exposure (Low-risk)"
  14.    Case 4
  15.       Me.Typeofsharpinjury.Value = "Prior wound or skin lesion contaminated with a body substance other than blood e.g. urine"
  16.       Me.Risklevel.Value = "Doubtful exposure (Low risk)"
  17.    Case  5
  18.       Me.Typeofsharpinjury.Value = "Mucous membrane or conjunctival contact with a body fluid other than blood"
  19.       Me.Risklevel.Value = "Doubtful exposure (Low-risk)"
  20.    Case  6
  21.       Me.Typeofsharpinjury.Value = "Intradermal (superficial) injury with a needle contaminated with blood or body subtance"
  22.       Me.Risklevel.Value = "Possible exposure (Medium-risk)"
  23.    Case  = 7
  24.       Me.Typeofsharpinjury.Value = "A wound NOT associated with visible bleeding, produced by an instrument contaminated with blood or body substance"
  25.       Me.Risklevel.Value = "Possible exposure (Medium-risk)"
  26.    Case  = 8
  27.       Me.Typeofsharpinjury.Value = "Prior wound or skin lesion contaminated with blood or body substance"
  28.       Me.Risklevel.Value = "Possible exposure (Medium-risk)"
  29.    Case  = 9
  30.       Me.Typeofsharpinjury.Value = "Mucous membrane or conjunctival contact with blood or body substance"
  31.       Me.Risklevel.Value = "Possible exposure (Medium-risk)"
  32.    Case  = 10
  33.       Me.Typeofsharpinjury.Value = "Skin penetrating injury with a needle contaminated with blood or body substance"
  34.       Me.Risklevel.Value = "Definite exposure (High-risk)"
  35.    Case  = 11
  36.       Me.Typeofsharpinjury.Value = "Injection of blood/body substance <1ml"
  37.       Me.Risklevel.Value = "Definite exposure (High-risk)"
  38.    Case  = 12
  39.       Me.Typeofsharpinjury.Value = "Laceration or similar wound which caused bleeding, and is produced by an instrument that is visibly contaminated with blood or body substance"
  40.       Me.Risklevel.Value = "Definite exposure (High-risk)"
  41.    Case  = 13
  42.       Me.Typeofsharpinjury.Value = "In laboratory settings, any direct inoculation with HIV tissue or material likely to contain HIV, HBV or HCV not included above."
  43.       Me.Risklevel.Value = "Definite exposure (High-risk)"
  44.    Case  = 14
  45.       Me.Typeofsharpinjury.Value = "Transfusion of blood"
  46.       Me.Risklevel.Value = "Massive exposure (High-risk)"
  47.    Case  = 15
  48.       Me.Typeofsharpinjury.Value = "Injection of large amount of blood/body substance >1ml"
  49.       Me.Risklevel.Value = "Massive exposure (High-risk)"
  50.    Case  = 16
  51.       Me.Typeofsharpinjury.Value = "Parenteral exposure to laboratory specimens containing high titre of virus"
  52.       Me.Risklevel.Value = "Massive exposure (High-risk)"
  53.    END SELECT
  54.  
  55. End Sub
  56.  
Also double check the names of the textboxes. You can do this in properties under the other tab. Make sure that the textbox names are what you think they are.

Mary
Sep 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
11025
by: Frank Py | last post by:
I have 4 possible values that I would like to populate a text box with depending on which 4 values are sleected in a select box. Is there an example out there for this? Thanks Frank *** Sent via Developersdex http://www.developersdex.com ***
2
18087
by: C. David Rossen | last post by:
Hello: I have a registration form for classes. Each class has a fee. I have a drop down box whereby the user chooses his class. There is a textbox with the associated fee. I would like to auto populate the fee textbox depending on what class the user chooses. In the email, the value of the drop down box has to be the name of the class and the value of the fee text box has to be the fee. Can someone please help me in accomplishing...
1
6361
by: Greg Scharlemann | last post by:
I would like to automatically populate a drop down menu when the page loads based on the selection of an item in a different drop down menu. I made a test page that when drop down #1 changes, drop down #2 populates. Does anyone know how to get drop down #2 to populate based on what is selected in drop down #1 when the page loads? Here is my test code: ************************************************************************ <html>...
20
12423
by: Dannyboyo | last post by:
I have what I hope is a simple request. I can't really code in javascript, but I am pretty good at cusomizing it with slight modifications. I code in ASP and HTML. I am trying to capture customer input of product names to put on custom labels we make. Some of the labels will have our product names on them, but the customer can add other products that we do not sell. So, on my product detail page I want a textbox that can have rows copied...
2
4939
by: James Goodman | last post by:
I have a listbox named sub1 on an asp page. I need to fill this list with values from a table. These are selected based upon the selection of a value/s in another listbox. It was suggested that I use a hidden iframe on my main page, & carry out the processing inside the frame, using jscript. If I open the page in a browser, & make a selection in the first listbox (named main), the data in the frame appears to be processed correctly, the...
1
3609
by: jzhang29 | last post by:
I have a JSP page and it contains a dropdown list called Office. What I try to do is: When I select different office from this list, the information of office (address, phone,etc) will be populated in same JSP page. I have a java bean called officeBean that contains all the office information.
6
4681
by: tinman486 | last post by:
Im new to the whole javascript game, I know pretty much just enough to be dangerous with no real substance. Anyway Im trying to populate a DIV with a website using the URL as an inner html source Here is my code I keep getting an error object expecte don line 58. Which I will highlight. Anyway Not only would i Like to know what that error is about but also if my logic is correct or if I can even do what im trying... and if not what other...
0
8814
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9187
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9079
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9032
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4730
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3160
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2528
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2113
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.