Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input Field Default Value

Status
Not open for further replies.

raa44634

Technical User
Dec 13, 2001
34
US
Let's say there's tblEmployee with a field EmpID that is auto-numbered. Data is added to the table via Page1.asp

For whatever reason, on Page2.asp we need to have Max(EmpID) pull up from tblEmployee in order to be loaded with some other fields into tblZ. So, tblZ has these fields requiring input: EmpID, Fld1, Fld2.

How can I get the default value of the input field for EmpID on Page3.asp to automatically populate with Max(EmpID) from tblEmployee? I've tried several ways and I can't solve it. (Really new at ASP).

THANKS!!!
 
Maybe I'm sleepy, but I really don't get your question
"How can I get the default value of the input field for EmpID on Page3.asp to automatically populate with Max(EmpID) from tblEmployee? "

Be more explicit, please

Regards,
Durug
 
Okay, I'll try.

Via Page1.asp, employees are setup in the database table tblEmployees and their EmpID (the primary key) is an auto-number field.

Next step, Page2.asp is going to load data into tblZ of the database where its fields are EmpID, Fld1, Fld2...etc. For tblZ, I need to have that EmpID where I can load it as a text field into tblZ.

Because the EmpIDs are sequentially assigned, it's always going to be the largest/max EmpID value used in Page2.asp.

Does this make more sense?
Thanks!


 
On the second page open a recordset
select max(empID) as maximid from tblEmplyee
and the only record will be max of EmpID
You have to open the recordset before displaying anything on the page and then when you will have the label or textbox
in page 2 you will display
<input type='text' value='<%response.write rs(&quot;maximid&quot;)%>'>

Did I answer your question?
 
I think so! I'll give it a try in a bit. Thanks for your time. May need you again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top