ASP/database problem am 29.03.2005 07:44:12 von Doug B
I hope I can make this clear:
I have an Access 2000 database that drives an ASP web site to track
sales leads.
There is a combo box , "units", that lists the inventory of models we
sell. Here's a code snippet
Fills the combo box:
<%
While (NOT leads1.EOF)
%>
<%=(leads1.Fields.Item("units").Value)%>
<%
leads1.MoveNext()
Wend
If (leads1.CursorType > 0) Then
leads1.MoveFirst
Else
leads1.Requery
End If
%>
This code works perfectly to fill the combobox with the model names
from the units table of the units db. Leads1 is the recordset that is
connected to the db
The 'units' table has three fields:
ID (autonumber - PK)
units - Text field
AnnValue - currency field
The form also has a readonly textbox, "AnnVal" to display the Annual
cost of the service contract for that unit.
Displays textbox:
size="15" readonly>
I want to populate that textbox with the data in the AnnValue field of
the units db. Based on the choice the user makes in the combobox, I
want the corresponding price to populate the read-only textbox.
I have seen several solutions that employ some Javascript with ASP to
get this to work but I have no idea how to implement these
suggestions. Being a real newbie, can someone offer some nicely
commented code to help me make this work the way I have described?
Thank you so much. You folks have always been so helpful!