Re: Data access page and a date field



I should have said in my previous message that the trigger was referring to
a datetime field and not a timestamp field.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF


"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:uRnFN0ywFHA.3124@xxxxxxxxxxxxxxxxxxxxxxx
> Contrary to what their name might tell, timestamp fields are not datetime
> field and they don't contain a date and time value.
>
> One way to do this would be to make it on the server side by setting the
> default value to getdate() - used when the record is created - and to
> create a trigger on the update event; for exemple:
>
> CREATE TRIGGER Equipes_DateModification
> ON dbo.Equipes
> FOR UPDATE
> AS
> Update E
> Set DateModification = getdate()
> From dbo.Equipes E inner join inserted ins on E.IdEquipe = ins.IdEquipe
>
>
> The default value for the creation date for new records can also be set in
> a Insert trigger instead.
>
> If you don't want to act on the server side, then you will have to perfect
> your knowledge of javascript.
>
> --
> Sylvain Lafontaine, ing.
> MVP - Technologies Virtual-PC
> E-mail: http://cerbermail.com/?QugbLEWINF
>
>
> "John Crerar" <JohnCrerar@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:3B432D65-FDE2-4412-911E-E0192B3F5F1F@xxxxxxxxxxxxxxxx
>> I'm trying to do pretty much the same thing. I have a DAP which is
>> linked to
>> a table that has a field timestamp. I want the current date and time to
>> automatically populate that field when a record is updated. I tried your
>> script, but it doesn't seem to do anything. Does it have to be inserted
>> somewhere specific?
>>
>> "PaulD" wrote:
>>
>>> "Gr8Gyro" <Gr8Gyro@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>>> news:18715096-C017-4BE0-900C-E91CB52537F7@xxxxxxxxxxxxxxxx
>>> : Does anyone know if I can default a date field on a data access page
>>> to
>>> the
>>> : current date and have it display the current date on the form when the
>>> data
>>> : access page is run?
>>> : Thanks.
>>> :
>>> : --
>>> : Gyro
>>>
>>> Is the date field part of the database or just a text box on the DAP?
>>> Either way, some VBScript can do the job.
>>>
>>> <SCRIPT language=vbscript event=DataPageComplete(oEventInfo) for=MSODSC>
>>> <!--
>>> 'if text box, use something like
>>> txtDate.innerText = Date()
>>> 'if a field from the database, use something like
>>> DateField.value = Date()
>>> -->
>>> </SCRIPT>
>>>
>>> Paul D
>>>
>>>
>>>
>
>


.



Relevant Pages

  • Re: Recordset not updatable
    ... A TimeStamp field is always a good idea, ... difficult for Access to query the data in those fields to accurately determine ... >> The problem is this, if I remove the WITH VIEW_METADATA, the VIEW will>> update the records, but I need to have the trigger running on the VIEW,>> therefore the WITH VIEW_METADATA must be in the VIEW. ... >>> Jeff Boyce ...
    (microsoft.public.access.queries)
  • Illegal regursion in triggers
    ... I have a table with a timestamp field which contains the datetime() of ... trigger but, of course, updating the timestamp in the trigger just creates ... the illegal recursion error. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: SQL Trigger and Microsoft Access
    ... you dont have timestamp field or you making some data ... manipulation with same table in trigger. ... "Anne" wrote in message ... > I have an SQL Trigger which update data in a table. ...
    (microsoft.public.sqlserver.programming)
  • Re: Howto catch changes in the database
    ... And here is code for touching a file based on a trigger. ... FROM employees' ... - Sahil Malik [MVP] ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: No trigger exception message
    ... >> Sylvain Lafontaine, ing. ... >>> trigger. ... >>> not show the error message of the trigger, the user has no idea what the ...
    (microsoft.public.access.adp.sqlserver)