Re: database update Combobox



On 10/31/2007 at 09:55:48, Clive_ <cliveswan@xxxxxxxxxxx> wrote:

Hi,
I have a combobox with values 1, 0, -1.
I want the selected item to equal the value in the database.
It may be 1, then the user changes it to 0.
You can 'read' the value from the database:
<option value=<%= rs.getInt(3)%> > </option>
How do you get the value in combobox to 'synchronise' with the
database. So if the value of rs.getInt(3) is 0.
The combox would have 0 selected.
PS got code for combobox & database from Java not JS??
Thanks
Clive

if you want a specific option to be selected, just print this html out.

<option value="whatever" selected> </option>

Note the "selected" keyword.

It will make the option show as selected.

You will want add an if check in your code to determine where to output the "selected" text though.

.



Relevant Pages

  • Re: finding data
    ... My question is how do I set up this database so when you open iti you ... In form design view make sure the Toolbox wizard is enabled (magic wand ... This will be the third choice in the first page of the ComboBox ... Rick Brandt, Microsoft Access MVP ...
    (microsoft.public.access.tablesdbdesign)
  • RE: Working Hours database
    ... My current database stores total hours on a weekly basis (as opposed to every ... SubdeptID ... an employee can have more than one reason to be absent so ... Workstat (combobox) ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Searching Through ComboBoxes
    ... The name of the combobox is PARID. ... combo boxes are linked to a table which is named Project_Inventory. ... ' This is where you add the code to create the resultset ... Don't forget to add code to close the database object db and the ...
    (microsoft.public.access.formscoding)
  • Re: How to populate text fields based on drop down lists selection
    ... My book's sample database also deals with authors and applications just ... I've got a combobox that pulls AuthorID, ... insert SPROC so I can add rows to the database. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Combo Box
    ... > other records in my database shows Mr also. ... >>If you are saying that you make a selection in the ... >>record you look at then the ComboBox is NOT bound. ... >>I don't check the Email account attached ...
    (microsoft.public.access.gettingstarted)