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: How to import certain fields from access database?
    ... thanks but i wanted to use the combobox on form so that the user can find the ... "Access a database and insert into a Word document the data that you find ... Doug Robbins - Word MVP ... Dim myActiveRecord As Recordset ...
    (microsoft.public.word.mailmerge.fields)
  • Re: How to import certain fields from access database?
    ... my suggestion of using a combobox was make because it is a more certain way ... "Access a database and insert into a Word document the data that you find ... Doug Robbins - Word MVP ... Dim myActiveRecord As Recordset ...
    (microsoft.public.word.mailmerge.fields)
  • 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: How to import certain fields from access database?
    ... To access the information in the other columns of the combobox, ... The first imports data from a database ... Dim myActiveRecord As Recordset ...
    (microsoft.public.word.mailmerge.fields)
  • Re: How to import certain fields from access database?
    ... Most probably the Combobox Exit event would be the best, ... Dim myActiveRecord As Recordset ...
    (microsoft.public.word.mailmerge.fields)