mramirez18
Posts: 56
|
| Posted: 08/15/2005, 6:31 AM |
|
What is the code I use to update modify_date when a record is updated using submit button.
I have made my field as Hidden ie date_modifiedH and I have a label field date_modified.
|
 |
 |
marcwolf
Posts: 361
|
| Posted: 08/15/2005, 6:47 PM |
|
Best way is to have a hidden field on your form that contains the modified date, and then in the BeforeBuildUpdate do something like this
With applic_topic1.Datasource
' the standard values that must be set for an INSERT
.Create_Datetime.value = now()
.Create_User_Id.value = Session("UserID")
.Change_Datetime.value = Now()
.Change_User_Id.value = Session("UserID")
.Version_No.Value = 0
End With
Hope this helps
Dave
_________________
' Coding Coding Coding
Keep Those Keyboards Coding.
Raw Code!!!!!!!
|
 |
 |
DonB
|
| Posted: 08/16/2005, 8:11 AM |
|
I like to use the Custom Insert/Update properties for this. Just add the
'modified date' field to list list of form fields that are there by default
and put in an Expression-type value, which calls the Now function (or
whatever you need). No hidden field is required.
--
DonB
http://www.gotodon.com/ccbth
"marcwolf" <marcwolf@forum.codecharge> wrote in message
news:6430145c4c5fbb@news.codecharge.com...
> Best way is to have a hidden field on your form that contains the modified
date,
> and then in the BeforeBuildUpdate do something like this
>
> With applic_topic1.Datasource
> ' the standard values that must be set for an INSERT
> .Create_Datetime.value = now()
> .Create_User_Id.value = Session("UserID")
> .Change_Datetime.value = Now()
> .Change_User_Id.value = Session("UserID")
> .Version_No.Value = 0
> End With
>
>
> Hope this helps
>
> Dave
> _________________
> ' Coding Coding Coding
> Keep Those Keyboards Coding.
> Raw Code!!!!!!!
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
marcwolf
Posts: 361
|
| Posted: 08/17/2005, 5:14 PM |
|
True DonB..
But does'nt that require the programmer to type the whole update SQL statement into the SQL textbox. With my suggestion you can easily modify one or two fields out of say 30.
Often when one has very large froms with lots of fields then creating the SQL can be a real pain when CCS does it easily for you in code.
If you have a better way of getting that SQL into the text area then please let me know.
Many Thanks
Dave
_________________
' Coding Coding Coding
Keep Those Keyboards Coding.
Raw Code!!!!!!!
|
 |
 |
DonB
|
| Posted: 08/25/2005, 8:09 PM |
|
No SQL required to be written at all. Just create the Custom Update/Insert
of type 'Table', then revise the list of fields you get by default (matching
all those present in the form) to add one more column for the date. Make it
an "Expresson" and put the appropriate value or function in the Expression
textbox. Whatever you enter there is executed as ASP code, not SQL, so put
in 'Now' to get the current date/time. Whatever it evaluates to is what's
stuffed into the SQL statement and stored in the database.
--
DonB
http://www.gotodon.com/ccbth
"marcwolf" <marcwolf@forum.codecharge> wrote in message
news:64303d2d93762f@news.codecharge.com...
> True DonB..
>
> But does'nt that require the programmer to type the whole update SQL
statement
> into the SQL textbox. With my suggestion you can easily modify one or two
> fields out of say 30.
>
> Often when one has very large froms with lots of fields then creating the
SQL
> can be a real pain when CCS does it easily for you in code.
>
> If you have a better way of getting that SQL into the text area then
please let
> me know.
>
> Many Thanks
>
> Dave
>
>
> _________________
> ' Coding Coding Coding
> Keep Those Keyboards Coding.
> Raw Code!!!!!!!
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |