468,544 Members | 1,750 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,544 developers. It's quick & easy.

Edit form with dropdownlist

Here it goes.... I am using ASP. language: VB

I have 2 database as follows....
Database1: User_Details
User_ID | User_Name
ST-David | David John
PUP-Peter | Peter Soh
ST-Kelvin | Kelvin Tan

Database2: User_Form
Data| Created_BY

I have 2 dropdownlist as follows....
First dropdownlist

Second dropdownlist
Will display the User_Name in User_Details database.

I need to create add, edit and delete. I already finish with the add and delete. I have problem with the edit. Do help me solve.

As mentioned, I already create the edit form. I have the trouble in displaying both the dropdownlist. I want the system to check the database (CreatedBy) and if the 'createdby' starts with 'ST', the word 'staff' will be selected for the firstdropdownlist and if 'createdby' is 'ST-DJ', his full name will be selected in the second dropdownlist.

I know I have to make the system check the user_details and so on.. But how to go about doing it?
Feb 24 '10 #1
1 1614
3,405 Expert 2GB
Let's look at one question at a time. First, the "edit". There are two ways to do an edit, if you are very familiar with SQL you would probably make an "update" statement that you can send tot he db, but I think it is easier to use a recordset object, and then call the update() method of the recordset. Are you using a recordet now to pull up the data? If so, you have something that looks like this:
Expand|Select|Wrap|Line Numbers
  1. set objRS = server.createobject("adodb.recordset")
  2. objRS.open queryString, objConn, 2, 3
to edit the recordset, simply navigate to the row you want to modify
Expand|Select|Wrap|Line Numbers
  1. objRS.moveNext
make the changes, then call "update"
Expand|Select|Wrap|Line Numbers
  1. objRS("UserName")="Jim Bob"
  2. objRS.update()
Let me know if this makes sense, and then we will move on.

Mar 2 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by NewToDotNet | last post: by
3 posts views Thread by Tim::.. | last post: by
3 posts views Thread by Tim::.. | last post: by
2 posts views Thread by P. Yanzick | last post: by
2 posts views Thread by Peter | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.