Clearing a date Control on a form

Liz_I3

Well-known Member
Joined
Dec 30, 2002
Messages
647
Office Version
  1. 2016
Platform
  1. Windows
Hi
Iam trying to clear a date control on a form that is formatted as a short date with an imput mask as 00/00/00;0;_ I cannot get the value of the contol to clear I have tried:
[mydate].Value = " "
[mydate].Text = " "
[mydate].text = """""
[mydate].value = """""
[mydate].value is null
:oops:
All my other fields clear with .text or .value = " "
Please what am I doing wrong

thanks
liz
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Have you tried simply [mydate]="" or [mydate]=Null? VBA works a little differently than VB in this respect.
 
Upvote 0
THANK YOU
yes [mydate]="" I could swear I tried that yesterday and it did not work

But I am very please it is working now. Do you know why in some cases I use " " and in this case "" why would it not be consistent?

Thanks Liz
 
Upvote 0
Not exactly sure what you mean. I always use "" to return an empty string. If you're getting an error with " ", this may be because the field in question is a date field and you're trying to place a single text character (even though it's just a space) into that field.
 
Upvote 0

Forum statistics

Threads
1,221,700
Messages
6,161,371
Members
451,700
Latest member
Eccymarge

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top