Clear out a value in a field

T

Tamer

I have a text box in an Access 2000 form. I added a cmd
button to the form to add a new record. I noticed that the
text box shows the number 0 after I add a new record
(because it holds an integer data type). Is there any way
to get rid of this 0?? I tried to use "Me![txt_MyInt].
clear", but it is not working. Any idea??

Thanks in advance
 
J

John

You probably have 0 defined as a default in the table (go
to design mode for the table and look to see whether you
have a default value defined for the field), or a default
value has been assigned to the control (look on the "Data"
tab under the properties for the control to see whether a
default value has been defined). Hope this works.

John
 
T

Tamer

Thanks. It works
-----Original Message-----
You probably have 0 defined as a default in the table (go
to design mode for the table and look to see whether you
have a default value defined for the field), or a default
value has been assigned to the control (look on the "Data"
tab under the properties for the control to see whether a
default value has been defined). Hope this works.

John


-----Original Message-----
I have a text box in an Access 2000 form. I added a cmd
button to the form to add a new record. I noticed that the
text box shows the number 0 after I add a new record
(because it holds an integer data type). Is there any way
to get rid of this 0?? I tried to use "Me![txt_MyInt].
clear", but it is not working. Any idea??

Thanks in advance

.
.
 
J

John Vinson

I have a text box in an Access 2000 form. I added a cmd
button to the form to add a new record. I noticed that the
text box shows the number 0 after I add a new record
(because it holds an integer data type). Is there any way
to get rid of this 0?? I tried to use "Me![txt_MyInt].
clear", but it is not working. Any idea??

Thanks in advance

Open the Table in design view, and replace the 0 in the Default
property of the field with nothing (just backspace over it).

The VBA would be

Me!txt_MyInt = Null
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top