473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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
A | ST-DJ
B | PUP-PS

I have 2 dropdownlist as follows....
First dropdownlist
--------------------------
staff
pupils

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 1709
jhardman
3,406 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.

Jared
Mar 2 '10 #2

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

Similar topics

12
by: Stanley J Mroczek | last post by:
How do you load a dropdownlist when edit is clicked in a datagrid ? <Columns> <asp:BoundColumn DataField="OptionDescription" ItemStyle-Wrap="True" HeaderText="Option...
2
by: NewToDotNet | last post by:
Hi, I am very new to ASP.NET and web programming in general. I have one issue. I have a Datagrid object with Edit template. In one Datagrid row, I have 1 DropdownList, 1 textbox and 1 readonly...
4
by: Glenn M | last post by:
I have a shared XML file on a server . i also have one xslt file that performs a simple transform on in to view the data. now i want to have another page that lets users modify the shared xml...
2
by: Dave | last post by:
Hi, I'm building a maintenance form for a table and some of the fields are textboxes (i.e name) and some should be dropdowns (i.e country of origin) When a user clicks 'Edit' in the...
3
by: Tim::.. | last post by:
Can someone tell me how I get the correct selected office in my drop down list when I enter edit mode. At the moment it just defaults to the office at the top of the drop down list rather than...
3
by: Tim::.. | last post by:
Can someone please tell me how I go about preselecting an item in a drop drown list when I click the Edit Command in a datagrid? I have tried the following but it doesn't work for me! I would...
2
by: Gummy | last post by:
Hello All, I have a webpage that has two dropdown listboxes. Based on what is selected in these dropdown listboxes, it filters a DataGrid . That works fine. In the DataGrid , when I go to edit...
2
by: P. Yanzick | last post by:
Hello, I am creating an edit template for a FormView control, changing one of the textboxes to a dropdown box. The dropdown will be populated from a simple table with the primary key, and a...
2
by: Peter | last post by:
ASP.NET 2003 In the DataGrid how do I select current cell value in the dropdown box when I click on the edit link, currently when I click on the edit link in the DataGrid the dropdown box...
0
by: bh | last post by:
I'm trying to edit data in a datagrid through a dropdown list with different id/text values. The problem comes in when I click the edit button & nothing appears to be happening. Did I do...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.