[AccessD] Remove Field Entry

Andy Lacey andy at minstersystems.co.uk
Mon Feb 16 15:29:38 CST 2004


Virginia
Assuming it's a bound field put this in the BeforeUpdate of the field (not
the form's BeforeUpdate)

If IsNull(Me.DateCompleted) Then
  MsgBox "MMR must be completed before approving"
  Me.ApproverID.Undo
  Cancel=True  
End If

Andy Lacey
http://www.minstersystems.co.uk 


> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com 
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of 
> Hollis,Virginia
> Sent: 16 February 2004 21:24
> To: 'Access Developers discussion and problem solving'
> Subject: [AccessD] Remove Field Entry
> 
> 
> Is this the correct way to remove an entry with Me.ApproverID 
> = Null? I tried Me.ApproverID.Undo instead, but the entry 
> remains. I tried moving the code to BeforeUpdate and it still 
> will not undo the entry, it requires the record to be saved first.
> 
> I have never seen it done this way before (=Null) so I wasn't 
> sure if it was the correct syntax.
> 
> I do not want them entering their name in the ApprovalID or 
> entering the approval date if the request is still open.
> 
> Virginia
> 
> Private Sub ApproverID_AfterUpdate()
> 
>     If IsNull(Me.DateCompleted) Then
>         MsgBox "MMR must be completed before approving"
>         Me.ApproverID = Null
>         Me.DateCompleted.SetFocus
>     End If
> 
> End Sub
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com 
> http://databaseadvisors.com/mailman/listinfo/a> ccessd
> Website: 
> http://www.databaseadvisors.com
> 
> 




More information about the AccessD mailing list