Home » Developer & Programmer » Forms » Populating a combo box from a table (Forms 9i, Oracle 10g)
Populating a combo box from a table [message #449045] Fri, 26 March 2010 06:57 Go to next message
rosswelsh
Messages: 42
Registered: February 2010
Location: Sunderland
Member
Me again with another question! Razz

I want to populate a combo box using values from a table, I know you can manually enter values in the combo box's property palette using the 'Elements in List' option, but this combo box will have changing values and I would prefer it to come from a table rather than manual entry so that when users add a new staff name to the table it will automatically be in the combo box.

Im guessing I would need to use a trigger on this combo box, but which is the best to use and im guessing the SQL needed is more than just 'select * from staffname'?

Thanks very much.
Re: Populating a combo box from a table [message #449047 is a reply to message #449045] Fri, 26 March 2010 07:04 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Are you planning on changing the values in the combo-box at runtime (apart from initally loading it that is)?
Re: Populating a combo box from a table [message #449048 is a reply to message #449045] Fri, 26 March 2010 07:18 Go to previous messageGo to next message
rosswelsh
Messages: 42
Registered: February 2010
Location: Sunderland
Member
The values will remain the same nearly all the time, except for when a new member of staff is added to the database (only about once a year or so), so I would require the list to check for any new values at runtime, and re-populate the list if necessary.
Re: Populating a combo box from a table [message #449049 is a reply to message #449045] Fri, 26 March 2010 07:26 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Fine then, if it was going to be changing constantly I would have advised against using a combo-box, but since it isn't look up the populate_list built-in in form builder help.
Re: Populating a combo box from a table [message #449055 is a reply to message #449049] Fri, 26 March 2010 08:02 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As far as I understood the situation, you'll display values from the database, right? Users won't add new values by themselves, but read what's found in a table?

If so, wouldn't simple List of Values do the job?
Re: Populating a combo box from a table [message #449062 is a reply to message #449045] Fri, 26 March 2010 08:39 Go to previous messageGo to next message
rosswelsh
Messages: 42
Registered: February 2010
Location: Sunderland
Member
The user(s) will add the new staff member name(s) to the staffname table yes, through an Add New Staff Member form.

The names from the staffname table then need to be displayed in the combo box, so im not sure a list of values would work that way would it?
Re: Populating a combo box from a table [message #449063 is a reply to message #449045] Fri, 26 March 2010 08:47 Go to previous message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Well you'd have to click a button to see the full list but it'd contain exactly the same data. In fact it's easier to add additional data to an LOV for display purposes.
Previous Topic: Problem in Mail Attachment
Next Topic: Arabic Characters Problem??!
Goto Forum:
  


Current Time: Fri Sep 20 05:39:42 CDT 2024