Clear form

rrmangus

New member
Local time
Today, 00:55
Joined
Jul 23, 2002
Messages
9
I have a data entry form with a clear/cancel button that runs a macro to delete current data in the form. I'm having a problem when there is no data in the form and the delete button is clicked(the macro throws an error). Can anyone suggest an easy way to solve this problem?

Thanks for your help.
 
You could pick one of your fields as a focus point and do the following in the forms current event:-

If Me.YourField = "" then Me.YourButtonControl.Enabled = False

There are may ways to do this

If IsNull (yourFieldName) then me.YourButtonControl.Enabled = False

Dave
 
Thanks! That's been bugging me for quite a while.
 

Users who are viewing this thread

Back
Top Bottom