Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql

Status
Not open for further replies.

xerife007

Technical User
May 7, 2002
40
PT
hi forum,

I have a situation thet I use in cmdAdd the command:

conn.execute "Insert into T_process(ID,PKCustumer) values(" & textfields(0) & "," & textfields(1) & ")"

conn.execute "Insert into T_dates(date1,date2) values(" & textfields(2) & "," & textfields(3) & ")"

the situation is, if I let, for example, the textfields(2) blank it give me a error.

thanks all


 
Depending on what you want your program to achieve, there are at least 3 alternatives:

1. Allow Null in your database

2. Check text for valid date (IsDate function)

3. Provide default date

Only you and/or your clients can decide which is appropriate.
Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Hi johnwm,

I would like to know more information about the alternatives.
If you don't mind. This is because i have a lot of tables and i have a realationship one-to-one for the table T_process and i use a lot Edmaskbox object to input dates format.

I wait your reply
It's very important for me to the best way or the fast way
 
1. Allow Null in your database
If one of the dates is unknown or to be determined later, then it may make sense to allow a blank date

2. Check text for valid date (IsDate function)
If the date is being left blank by the user accidentally then do some error checking before allowing a save operation:
If Text1.text = whatever then msgbox "You must enter a date"

3. Provide default date
If one date is normally today's date then default to today:
If Text1.text = "" then text1.text = date

Only you and/or your clients can decide which is appropriate. Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 


I'm interested in the first case. because the dates are determined later.
i guess that you must do some thing like that in all dates:
text1.text=Null


I understand your point but i don't have some practice to implement the code.













 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top