Date field with no entry - copy forward

  • Thread starter Thread starter Leonard Priestley
  • Start date Start date
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
 
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
 
Back
Top