Reply
No value in Form Date field
Old 11-16-2007, 10:32 AM No value in Form Date field
ChipJohns's Avatar
I don't know! Do you?

Posts: 477
Name: Chip Johns
Location: Savannah Georgia
What to do. I get messed up with dates all the time.

I have a form that adds a record to an access db.

There is a form date field that may or maynot have a value in it.

If the form field is empty (no date entered,) and no value is passed the sql statement crashes.

What can I do to make this work? Is there a way of using an if statement in the sql statement to exclude adding a date when none exists? Or, is there another method to keep this from crashing on me?

I hope this makes sense..

Thanks for any help..

Chip
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
When You Register, These Ads Go Away!
     
Old 11-16-2007, 01:50 PM Re: No value in Form Date field
chrishirst's Avatar
Super Moderator

Posts: 11,495
Location: Blackpool. UK
You would need an SP or a UDF to use if ... then in an INSERT query neither of which Access is noted for

simplest way would be to set a default value using ASP or not concat the column name and the value into the command string before sending the query
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-16-2007, 03:43 PM Re: No value in Form Date field
ChipJohns's Avatar
I don't know! Do you?

Posts: 477
Name: Chip Johns
Location: Savannah Georgia
"not concat the column name and the value into the command string before sending the query" I think this is the way to go.

Thanks Chris. As always, I appreciate your help.
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Reply     « Reply to No value in Form Date field
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11314 seconds with 13 queries