473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Extracting value/selected item from combo box

30
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 5095
amitpatel66
2,367 Expert 2GB
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
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 Expert 2GB
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
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...
2
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...
8
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...
2
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...
1
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...
4
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
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...
2
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...
1
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.