473,795 Members | 3,048 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extracting value/selected item from combo box

30 New Member
Hi,

I need to obtain the value of the selected item from a combo box.

Expand|Select|Wrap|Line Numbers
  1. BEGIN
  2.     IF :LOGIN_BLOCK.USER_TYPE = 'Student' THEN
  3.         :GLOBAL.student_id := :LOGIN_BLOCK.ID;
  4.         CALL_FORM(:GLOBAL.project_path || 'ENROLLMENT_FORM.fmx');
  5.     ELSE
  6.         :GLOBAL.staff_id := :LOGIN_BLOCK.ID;
  7.     END IF;
  8. END;
That is the code I have to do this but it doesn't work, it always accesses the else section of the statement.

The LOGIN_BLOCK is the data block, and the USER_TYPE is the combo box that contains "Student" and "Staff".

I need the If statement to see which one is selected so that a global variable can be assigned a value and a specific form can be called.

Thanks
Sep 20 '07 #1
3 5129
amitpatel66
2,367 Recognized Expert Top Contributor
Hi,

I need to obtain the value of the selected item from a combo box.

Expand|Select|Wrap|Line Numbers
  1. BEGIN
  2.     IF :LOGIN_BLOCK.USER_TYPE = 'Student' THEN
  3.         :GLOBAL.student_id := :LOGIN_BLOCK.ID;
  4.         CALL_FORM(:GLOBAL.project_path || 'ENROLLMENT_FORM.fmx');
  5.     ELSE
  6.         :GLOBAL.staff_id := :LOGIN_BLOCK.ID;
  7.     END IF;
  8. END;
That is the code I have to do this but it doesn't work, it always accesses the else section of the statement.

The LOGIN_BLOCK is the data block, and the USER_TYPE is the combo box that contains "Student" and "Staff".

I need the If statement to see which one is selected so that a global variable can be assigned a value and a specific form can be called.

Thanks
Check below Steps:

1. Go to the property palatte of the COMBO BOX.
2. For the property "Element In the List", click on that.It will display LIST OF ELEMENTS WINDOW
3. Check the LIST ELEMENT and LIST ITEM VALUE associated with the LIST ELEMENT.
Eg: For LIST ELEMENT = 'Student' LIST ITEM VALUE also should be equal to 'Student'. Only then your IF condition will Work.
Sep 20 '07 #2
mlevit
30 New Member
Check below Steps:

1. Go to the property palatte of the COMBO BOX.
2. For the property "Element In the List", click on that.It will display LIST OF ELEMENTS WINDOW
3. Check the LIST ELEMENT and LIST ITEM VALUE associated with the LIST ELEMENT.
Eg: For LIST ELEMENT = 'Student' LIST ITEM VALUE also should be equal to 'Student'. Only then your IF condition will Work.
Thanks for that mate, I got it about 2 hours ago.

I was surprised each element have a value associated with it. Makes it a bit more complicate.

Thanks, anyway.
Sep 20 '07 #3
amitpatel66
2,367 Recognized Expert Top Contributor
Thanks for that mate, I got it about 2 hours ago.

I was surprised each element have a value associated with it. Makes it a bit more complicate.

Thanks, anyway.
You can make it simpler by associating a simpler value with each combo box items.
Say 0 from student and 1 for staff
Sep 20 '07 #4

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

Similar topics

16
11501
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not an object... the function is like so: function calc_total() { var x,i,base,margin,total,newmargin,newtotal; base = document.frmKitAmount.txtTotalKitValue.value; margin = document.frmKitAmount.margin.value/100;
2
8233
by: Terry Bickle | last post by:
Please forgive me for using the wrong term here or there. I'm an old Excel 4 macro guy who didn't convert to VB and I'm tinkering with an Access 2000 DB. I'm sure there is a simple Access 101 answer for this. I have a subform which the user selects an item description from a combo box from a table. I want to obtain the cost for the item (another field in the table) also. I've been able to produce the second data field by rewriting the...
8
12108
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the combobox. What is the solution? Thank you in advance.
2
2397
by: Brian Henry | last post by:
say I have a databound combo box, which allows for text entry still (DropDownStype = DropDown in this case). now, If the user doesn't enter manually an item in the data bound list, nothing should be selected of course, but I want if a user enters an item that is in the list already, to select it, and only if the item is a complete match to what they typed to be selected. This is kind of like an auto complete scenerio, but allows for...
1
6131
by: sara | last post by:
I am learning how to use simple functions to make my apps more powerful and efficient. On one screen, I want to populate field B: ItemDescription by looking up the ItemDescription in the Items Table. I would use the key to the Items Table from the selection the user made in the combo box. SO: User chooses an item from the combo box whose value is "3". I want to look up the ItemDescription of the Item with the Key "3" and show that...
4
8961
by: deko | last post by:
Basic question about checking the value of Toggle/Check/Combo/OptionGroups.... Checking like this: If Me!chkCheckBox Then ... End If and like this:
7
12277
by: sara | last post by:
I have a form where the user selects an item from a list box, and then works on that item. The user chooses an AD, then opens a form to assign departments to the ad. The top of the Depts form has a combo box, to select an ad from the drop down list. I would like the Depts form to open with the Ad selected on the Main form displaying in the combo box, AND any information already added presented to the user. (I am thinking this latter...
2
2099
by: Tony A. | last post by:
The application I'm working on has three tables State, Customer, Orders. In the first combo box the State is selected. Based on the State selected the second combo box will be populated with the Customers in that state. Based on the Customer selected a datagrid will be populated with the customer's orders. I setup the query for the secont combo box as follows: Select CustName From tblCustomer Where State = @cboState
1
2375
by: Tim | last post by:
I'm working on a form where a combo box gets its list of values from a table. That same table also contains some "default notes" in other fields. My task is simple, but I'm having a hard time working it out. Once an option is selected in the combo box, I want to run (a macro?) that will grab the appropriate default notes from the table, and load them into the form in the various Notes fields. I've got a query set up that'll narrow the...
0
9672
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
10439
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
10215
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
10165
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
9043
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...
0
6783
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();...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
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.