CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Update hidden field using 'before update' event

Print topic Send  topic

Author Message
Ole Kirkholt
Posted: 01/20/2004, 5:05 AM

Hello

I starting my first .net project (vb.net), after working with ordinary asp for years.

I have a record-form that is updating the table 'customer'
In the form i have a hidden field 'changed_date' that i would like to set to the current date and time of the last update.

In normal asp I would do something like:

customer.changed_date.value = now()

How do I do this in vb.net using the 'before update'-event of the record-form ?

Best regards

Ole
RClayH
Posted: 01/20/2004, 6:29 AM

The easiest way to do it, would be to set the default value to be CurrentDateTime. Just set the field data type in the properties to DateTime and the default value to CurrentDateTime. If you always want to change the value of that hidden field to the current time. I would, in the Before Show event of the hidden field, create an action Retrieve Value for Control. Source type would be Expression and source name would be System.DateTime.Now(). You can then double-click the action in the Events lists and tweak the code if you need to. You'll end up with something like:

myFormNamemyControlName.Value = System.DateTime.Now()

or you can even just use Now() like you did before. Good luck. VB.NET is a blast.
Ole Kirkholt
Posted: 01/22/2004, 12:34 AM

Hello

Is is an existing value that I want to update, so setting the Default value won't work

What I want is to update a date file in a existing record with the date and time of the last update of that record ?

Best Regards
sdgsystems
Posted: 01/22/2004, 7:46 AM

What database are you using? If using SQL, you could just use the getDate() function within the db itself which is much more efficient.
sami
Posted: 03/29/2004, 11:25 PM

I would like to ask you something.
I have a combobox 'cbostockno'. I saved a certain value in it like '1222' from a list of values.
Now if i want to edit it like from 1222 to 1223 a msg should come
'Are you sure you want to continue' yes , no, if yes then nothing should happen
and the change is accepted, if no then restore his previous value(to 1222).(because he already changed the value to 1223). I am using onchange event.
My question is how can i restore the previous value if he clicks 'No'


< script language="VBSCRIPT" FOR "Cbostock" event="onchange">
dim a
a=msgbox("Are you sure you want to continue..?" vbyesno)
if a =vbyes then
.........
else
if a =vbno then
???????



Best Regards

sami
Posted: 03/30/2004, 11:42 PM

;-):-|:-(:-<:-O:-@:-X:-/:*):(

Plz reply I am waiting

regards
srinivas

Posts: 54
Posted: 03/31/2004, 9:33 AM

One way might be to store the changed value to a SESSION and retrieve on NO and COMMIT on YES.

-Srinivas
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.