Date field with no entry - copy forward

L

Leonard Priestley

Is there any value that can be stored in the default value of a textbox
control to give a blank entry for date?
I want to use a command button to copy forward a number of fields including
three date fields. I am saving the value to be copied in the default
property of the control. It works fine for text fields. However, the dates
only work when there is a date to be copied. If the date fields are empty
for a record I want to copy, I can't find any value that will not give some
sort of error message.

Leonard Priestley
 
M

Mark A. Sam

Leonard,

You can try two things.

1- Trap the error something like this:

If err = 1234 then
Resume Next
Else
MsgBox err.Description
EndIf

Or in your code you could copy the default value into a Variant variable and
test it for null before you use it.

Dim varDefault as Variant
varDefault = [myControl].DefaultValue

If isnull(varDefault) then
<Whatever>
Endif

God Bless,

Mark A. Sam
 
T

Ted

I believe you can just assign an empty string such as:

me.controlname.defaultvalue = ""
 

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