CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 editable grid: accessing/modifying values based on conditions

Print topic Send  topic

Author Message
Chris__T


Posts: 339
Posted: 06/17/2008, 12:52 PM

Wanted values to change in an editable grid based on a condition, in the same record (of course)

ex. If the user selects (from a listbox) "holiday", then the corresponding HOURS textbox automatically puts in "8"

I've read the article from Nicole regarding accessing values in editable grids (http://forums.codecharge.com/posts.php?post_id=60507), but I don't know if anything in there can help...it's mostly looping through the entire editable grid. Unless that is something I need to do.
View profile  Send private message
Oper


Posts: 1195
Posted: 06/24/2008, 11:15 AM

Crist if you only need to update the HOURS
you could use before UPDATE/INSERT

or use AJAX autofill on CCS 4
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
Chris__T


Posts: 339
Posted: 06/25/2008, 8:35 AM

So, have the user select "Holiday" and then when they hit the submit button, the use the UPDATE/INSERT for the hours field to stick the 8 in before being submitted to database?
View profile  Send private message
Oper


Posts: 1195
Posted: 06/25/2008, 1:49 PM

Yes Sir.

I use somethign Similar
in a Listbox you choose a Year and in Another ListBox you choose Marital Status then
i have a Hidden field.

and Before Update/insert based on any check calculation etc o read another Database
i update the hidden field.



_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
Chris__T


Posts: 339
Posted: 06/26/2008, 7:31 AM

Does this work with editable grids?
View profile  Send private message
Chris__T


Posts: 339
Posted: 06/26/2008, 1:10 PM

Function Employee2_BeforeSubmit(Sender) 'Employee2_BeforeSubmit @2-4529F885  
  
'Custom Code @44-73254650  
  
If (Employee2.Other_code.value = "Holiday") then  
	Employee2.Other_hours.Value = 8  
end if  
'End Custom Code  
  
End Function 'Close Employee2_BeforeSubmit @2-54C34B28

Is in "Before Submit" event for the editable grid. But that doesn't set Other_hours to 8 when I check the database.

I think it has something to do with it being an editable grid, and since there are x amounts of rows, it needs to be something like:

If Employee2.Other_code[x].value = "HOliday" then Employee2.Other_hours[x].value = 8
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.