database - How do I make a button in an MS Access form create a date stamp, THEN not allow further edits? -


the code date stamp simple enough.

private sub cmdmybutton_click() txtthingdatestamped.locked = false txtthingdatestamped = now() txtthingdatestamped.locked = true end sub 

but users can still hit date stamp multiple times , can edited other forms.

i used ms access project management template start adventure here. 2 forms i'm working (1) "project details" , (2) "project list".

you use before change data macro on table enforce constraint @ level:

enter image description here

<?xml version="1.0" encoding="utf-16" standalone="no"?> <datamacros xmlns="http://schemas.microsoft.com/office/accessservices/2009/11/application">   <datamacro event="beforechange">     <statements>       <conditionalblock>         <if>           <condition>updated(&quot;thingdatestamped&quot;)</condition>           <statements>             <conditionalblock>               <if>                 <condition>not isnull([old].[thingdatestamped])</condition>                 <statements>                   <action name="raiseerror">                     <argument name="number">1</argument>                     <argument name="description">an existing datestamp cannot altered.</argument>                   </action>                 </statements>               </if>             </conditionalblock>           </statements>         </if>       </conditionalblock>     </statements>   </datamacro> </datamacros> 

Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -