List Box Data Source

J

Jonathan

Hi Everyone!

TGIF!!!!!!

I have been trying to find a way to make the contents of a list box on an
input form use the values from a db table. I know how to do this for a
results page but how do I do it for a form?

Tia


Jonathan
 
S

Stefan B Rusynko

To display all values from a table (opened as a DB connection to objRS)

<%
objRS.MoveFirst
Do While Not objRS.EOF
%>
<option value="<%= objRS.Fields("FieldName")%>">
<%=objRS.Fields("FieldName")%></option>
<%
objRS.MoveNext
Loop
%>




| Hi Everyone!
|
| TGIF!!!!!!
|
| I have been trying to find a way to make the contents of a list box on an
| input form use the values from a db table. I know how to do this for a
| results page but how do I do it for a form?
|
| Tia
|
|
| Jonathan
 
J

Jonathan

Thanks for this Stefan,

Can I be really stupid - cos I use the database wizard most of the time or
create a form from sctratch and just select the database from my site list I
am not sure how to use two database sources.

You say "opened as a DB connection to objRS", is there a KB article on this?

Cheers

Jonathan
 
J

Jonathan

Thank you Kathleen - but I am not wanting to get results I am wanting to
populate a list box in an input form, is this easy?
 
J

Jonathan

Hi Kathleen - me again!!!

Scratch that last reply, I have just got the gist - I have copied the field
form a dummy result based on the fields in the table I wanted and then added
the field to the innput form and it work!

Hurrah - thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top