|
-
Dec 11th, 2001, 01:07 PM
#1
Empty Textbox
I want to ask one question, I hope someone can help me.
When I add a new record to database, I write this code:
rs.AddNew
rs![Name] = txtName
rs![Closedate] = txtClosedate.
rs![Cost] = txtCost
rs.update
rs.Close
db.Close
In Access database, [Name] is a text, [Closedate] is a date/time, [Cost] is a number. And all the Required = No in their field properties.
The problem is if the user only input the name, but the txtClosedate and txtCost is empty, because it's open, it isn't necessary to close and without cost right now. When you click the Save button, it causes a "Data Type conversion error".
I know Name I can check Allow Zero Length = yes, then whatever you enter nothing, it does't has error, but I don't know how to handle the date/time and number.
Welcome email to me or post on board
Thanks a lot!
Joanny
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|