CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Same value always selected in ListBox no matter what

Print topic Send  topic

Author Message
PaoloValladolid

Posts: 11
Posted: 05/19/2004, 12:29 PM

The default selected value in the ListBox of my search Record is always the same.

I have tried the following:

1. Checking the SQL query that retrieves and binds values for the Bound Column and the Text Column of the List Box

2. Right-click the ListBox, select "<SELECT> Properties", and remove the one entry ("Select Value") under Options.

Neither of the above worked - the same item is always preselected. I want the default selection to be the first item retrieved in my query.

I am using SQLServer and ASP 3.0.
View profile  Send private message
peterr


Posts: 5971
Posted: 05/19/2004, 12:57 PM

Do you have anything specified in the "Default" property of that listbox?
What are all the ListBox properties?
What is specified in the "Data Source" property of your Search form?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
PaoloValladolid

Posts: 11
Posted: 05/19/2004, 1:04 PM

These are the relevant ListBox properties:

Control Source Type=Database Column

Control Source=skillTypeNm

Data Source Type=SQL

Data Source=
select distinct skillTypeNm from Skills
order by skillTypeNm

Bound Column=skillTypeNm

Text Column=skillTypeNm

Data Type=Text

The rest of the properties other than Name and Connection are set to blank
View profile  Send private message
peterr


Posts: 5971
Posted: 05/19/2004, 1:19 PM

This doesn't look right.
Are you sure that this listbox is inside a Search form? What about the "Data Soruce" property of your Search form that I asked above?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
PaoloValladolid

Posts: 11
Posted: 05/19/2004, 1:24 PM

Sorry, Peterr, I thought you meant the Data Source of the ListBox.

I looked at the Data Source of the Search Record and saw that it was missing an "order by" clause. I added the clause and now the ListBox defaults to the first item like it was supposed to.

Thanks!
View profile  Send private message
peterr


Posts: 5971
Posted: 05/19/2004, 1:35 PM

Hmm, I'm glad that this works the way you want now, however the real problems seem to be:
1. Your Search form's "Data Source" should be blank
2. Your ListBox "Control Source" property should be blank.

This is actually the main difference between a Search form and a Record form. The Search form is exactly the same as the Record form, except it doesn't have Data Source.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
PaoloValladolid

Posts: 11
Posted: 05/19/2004, 1:49 PM

I set the Search Form Data Source to blank and set the ListBox Control Source to blank. This is the result:

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'Cmd.Connection'
/Dev/Personnel_Skills_List.asp, line ...

I had to set the Data Source of the Search Record object back to something in order to get it to work again.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.