Help with combo box BeforeUpdate

PeteJM

Registered User.
Local time
Today, 01:19
Joined
Oct 31, 2004
Messages
28
Hi, I'm trying to prevent a user from picking a status if there is no end date.

I'm thinking that if i undo what they pick and go to the end date field they could enter a end date.

It would be nice if i could create a message box to tell them that they have made an error aswell.

I have the following code but it dos not work.

-------------------------------------------------------------------------

Private Sub CS_Status_BeforeUpdate(Cancel As Integer)

If SC_EndDate Is Null Then

DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

Me!SC_EndDate.SetFocus

Else

End If

End Sub

--------------------------------------------------------------------------

Can anyone help?

Regards

Pete
 
try on the cbo BeforeUpdate event

if me!EndDate & "" = "" then
Cancel = true
exit sub
end if
 

Users who are viewing this thread

Back
Top Bottom