473,770 Members | 5,091 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 2333
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
11026
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
18088
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
6365
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
12437
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
4941
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
3611
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
4682
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
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10228
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10057
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...
0
9869
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
8883
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6676
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3970
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
3575
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.