[AccessD] A2K: Stop User from oving to new record

Darren DICK d.dick at uws.edu.au
Sun Apr 4 20:28:42 CDT 2004


Hi Bryan
I did that no joy eg.

Private Sub Form_BeforeUpdate(Cancel As Integer)

If IsNull(Me.cmbOffence) Or Me.cmbOffence = "" Then
    MsgBox "Enter an offence"
    Cancel = True
End If

End Sub

What I need to do is somehow test if the user is on a new fresh record or has left th previous record with unfilled combos. Of
course I can do it on the lost and got focus event.Thats fine whilst I am in the record
EG record 5 has no offence recorded
User goes to record 6 How do i alert the user that record 5 has a missing value then go back to that record?


----- Original Message ----- 
From: "Bryan Carbonnell" <carbonnb at sympatico.ca>
To: "Access Developers discussion and problemsolving" <accessd at databaseadvisors.com>
Sent: Monday, April 05, 2004 10:25 AM
Subject: Re: [AccessD] A2K: Stop User from oving to new record


> On 5 Apr 2004 at 10:08, Darren DICK wrote:
>
> >  I have a simple subform with 4 fields on it
> > ID (PK),  txtDateOfOccurence, cboClientName, cboOffence
> >
> > How can I tell if the user goes to a new record and they have not
> > completed ALL fields in the previous record How do I alert them and
> > then direct them back to the previous record?
>
> Use the before update event of the form. Check to make sure they
> entered a vale and if not set Cancel = true in the event. That should
> prevent the record from being saved and keep the sub form on the
> "unfinished" record
>
> -- 
> Bryan Carbonnell - carbonnb at sympatico.ca
> The trouble with doing something right the first time is that nobody
> appreciates how difficult it is.
>
>
> -- 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com




More information about the AccessD mailing list