-
How to lookup an edit value based on another edit value
Before we spent a lot of time to program a data access solution using asp or aspx, we should see whether there is an easier approach using SQL. For example, one user wants to have a combobox in edit and the text box below that is supposed to contain a lookup value based on the value in the combobox. The thought of using dbEditValidateName to build a Js to insert the value into the textbox comes to mind right away. If you look into it more, you would find out that using dbEditxxxSQL will be a better choice (xxx = update or add). dbEditxxxSQL is a user SQL with macro fields that will be executed in lieu of the standard one built by ASP-db. Look at the following example ->
update employees set title = (select title from employees where employeeid = 5) where employeeid = 1
This example shows that when employeeid is changed, the title will be changed according to the lookup value of employeeid. Just wrap the values with [[..]] to form a macro.
Fk
Last edited by Frank; 05-11-2008 at 01:13 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|