What is the default file of an empty field?

  • Thread starter Thread starter Tbird2340
  • Start date Start date
T

Tbird2340

Stupid sounding question.. I know.. But here's whats up. I have an ASP page
with the code below:

If (rsHelpRequest.Fields.Item("FirstContactDate").Value) = "" Then

Now.. What I want is for the code I have after that to execute if the
"FirstContactDate" is empty.. However, it doesn't happen even though it's
empty! I tried changing the value from "" to "null" , null, " " , and I
still get nothing! However, if I change the value to an exact date.. Say
"01/01/2001" and then enter that value in the database for that field the
code after it executes!!! So I know my code works and it's just the "value"
that I need to figure out..

Thanks
 
Try this:
If (IsNull(rsHelpRequest.Fields.Item("FirstContactDate").Value)) Then...
 
Hey TBird,

for forms, not sure bout ASP, but should be the same kind of thing:
you need to set the Default Value for the field: = Null (no quotation marks
or anything), either in the field properties, or perhaps more usefully in the
table where the field comes from.
Then you can do in VBA: If IsNull (me.field) Then...

hope that helps.

Nigel
 

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

Back
Top