Warning on a field change.

radink

Registered User.
Local time
Today, 07:17
Joined
Dec 21, 2006
Messages
18
Hey all,

Thanks for all of the help you have already given me.

Here's another.

What I'm trying to do it get a field, which is a combo box, to pop up a warning when someone tries to change it. I'm trying to keep people from unknowingly change the name field of the time sheet. I only want the warning to show if the field being changed already has a name in it.

Here is what Ive tried.

Code:
Private Sub Employee_BeforeUpdate(Cancel As Integer)
If Not IsNull(Me.Employee) Then
    MsgBox "Are You Sure?"
  End If
End Sub

The warning works, but it shows up regardless of the field being empty or filled.

I'd like to have it so I get a msgbox using vbyesno to give the user a choice whether to keep the change or accept it.

Any help would be greatly appreciated.
Thanks again!

The
 
Assuming a bound control, try: If Len(Me.Employee.OldValue & "") > 0 Then
 
RuralGuy said:
Assuming a bound control, try: If Len(Me.Employee.OldValue & "") > 0 Then

That worked! Awesome Thanks!!

Now just to figure out the rest.
 

Users who are viewing this thread

Back
Top Bottom