Delete contents of a text box!

B

Bob Vance

This code is not trigering my ckbBachInvoice, instead of ="" I need the
code to delete contents of tbEmail...........Thanks Bob V

Private Sub cmdDeleteEmail_Click()
tbEmail.value = ""
Me.ckbBachInvoice = 0
Me.Refresh
End Sub
 
A

Allen Browne

Try setting the value to Null instead of a zero-length string:
Me.txtEmail = Null

Then save the change:
Me.Dirty = False
 
B

Bob Vance

Thanks Allen , works fine without using the Me.Dirty do I need it and if I
do where do i place that code ....Thanks Bob V
 
D

default105

Yes you should use it or else it might not be saved when the form is closed
under certain circumstances
--
Pete Blackburn - words to live by:
"Don''t ever let somebody tell you. You can''t do something.You got a
dream,You gotta protect it." Edited Quote from the Pursuit Of Happiness
 
A

Allen Browne

Depends if you want the record to be saved at this point, or whether there
could be more changes to be made before you save the record.

If you want to force the record save, it will be after other changes you
make, (e.g. instead of the Me.Refresh line.)
 
Top