> but I still want to learn how to take complete control of inserting a date into the table
Robeen:
Three things:
1. As I mentioned in my second post to use brackets around the DateTime field, and as DonPeters also mentioned later, it may be a good idea to get in the habit of using brackets around all Table and Field names - always.
Obviously, that would have solved the problem at the begining.
2. You should
always format the date being inserted, unless the date is hard coded to the provider's specific syntax.
The reason for this, is if you use a date variable, or a string variable to insert a date, and your program is ran on another local, you will have problems.
Formating the date will insure that this doesn't happen, as the date will always be formated in US format.
JET:
"INSERT INTO receipts (Folio,Amount,Code,[DateTime]) VALUES ('44444',555.50,'TUI4'," & Format$(dtSomeDate, "\#mm\/dd\/yyyy\#"

& "

"
Replace the # sign as needed, with ', depending on the
provider's specifications:
SQL Server:
"INSERT INTO receipts (Folio,Amount,Code,[DateTime]) VALUES ('44444',555.50,'TUI4'," & Format$(dtSomeDate, "\'mm\/dd\/yyyy\'"

& "

"
HOWEVER, a word of caution, when running your program on a differen local:
In this case, you are JET. Putting single quotes around the date will not work correctly on certain locals.
Jet handles these values as strings, and not dates, so it converts the value
based on the local's settings.
This means that a date of 10-02-76 may be converted to 02-10-76 (as in German: dd.mm.yyyy)!
Using #10-Feb-76# will work however, if hard coded, but not in a date variable. It will format to the local settings when passed the the SQL statement.
And '10-Oct-76' will not work because the conversion cannot take place, as the local may
not be in english lanuageand "Oct" will not work (German Okt = Oct).
And #10-Okt-76# (German short month name) will not work because the month is not in english, and you are trying to send a US date as identified by use of the # sign.
So, the
ONLY way to have complete control over the dates in an SQL statement is to format the date into US format as I have shown above in the Insert statement.
3.
One thing that was curious in your original posts, was the fact that an error wasn't returned when there were no brackets around that DateTime field.
This should have produced an error from the start, and not just continue with-out updating the recordset.
So, it looks like the code is indeed erroring out and posting an error "at the bottom of the form".
For this type of error, it may be better to display it in a messagebox in order to make you fully aware of it, at least until the program is finished.