GabrielAkoh
Posts: 9
|
Posted: 08/26/2008, 8:00 PM |
|
Hi,
Am really new and would want training on web application, but for now, I need a quick help.
I placed the following on Before Insert without result:
1. myform.Username.Value = CCDLookUp("emp_login","employees","emp_id=" & DBConnection.ToSQL(CCGetUserID(),ccsInteger), DBConnection)
2. myform.TransID.Value = CCDLookUp("last(TransID)","Master","UserDept= " & myform.UserDept.Value, DBConnection)+1
Really, I want the current username and to increment transid for current userdept. For the transid, if I specify explicitly the value of userdept (that is say "101" in place of myform.UserDept.value), it works. However, I want the specified userdept on the page.
Thank you.
|
|
|
Oper
Posts: 1195
|
Posted: 08/27/2008, 3:30 PM |
|
UserDept is on your from?
Are you aware that will only work in Insert (not on update) right?
also is prefer to use before Build Update Instead and
try Myform.Datasource.UserDept.value
use:
Response.write "["& myform.userdept.value & "]"
before sentence to see what data is coming. or datasource what ever you choose to test
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
|
|
GabrielAkoh
Posts: 9
|
Posted: 08/28/2008, 8:25 AM |
|
Thank you.
The userid was null because the page was not restricted therefore did not log in. As soon as I log in, the username update was solved.
I tried before build insert and others to no avail. So I placed my codes inside the insert_button function and got around it.
Now I have a similar but different case:
I have an editable grid with some hidden fields to be updated as changes are submitted. For instance LastUpdateDate = Now() if any change is made. I tried all available events without success. They do not respond even to response.write. I tried to achieve the update using the same step as earlier but did not succeed.
Is it not possible to update a field on an update of another? For instance,
myform.dept_description.value = CCDLookUp("description","Department","Dept_Code= " & myform.UserDept.Value, DBConnection)
whenever UserDept is entered.
(where dept_description is not a database field)
Please assist!
|
|
|
|