Hi Fergus, thanks for your interest. Let me explain the problem a little
bit further. In the program, a user can clock-in (Simply the current
time is written in the "ClockStart" column of the TimeLog table). User
can also clock out with the same procedure(Those are accomplished with
another form class). The form that I am working on and having problems
is the timelog form, where a user can view all the clock-ins and outs
for the previous week.
This is shown with a datagrid. What I am trying to do is, if the user
forgot to clock out, a clock out value could be entered using this
datagrid later.
In this datagrid, I can change the clock-in and clock-out values and
update it successfuly. It also lets me to delete records or add new
records if I enter all the fileds in the correct format. But if the
clock-out value is null (which means, the user has clocked in first, but
not clocked out yet), I cannot update the datagrid when I enter a new
time value in the clock out field. This error is given:
"Concurrency violation: the update command affected 0 records."
And in response to you questions:
1) When you say 'updating when a date is null'. Do you mean that you can
create a new record with one valid date and one null and <then> you
can't change the null date? Or do you mean that you can't create a new
record with a
null date <in the first place>?
Actually, in this form, I cannot create a new record with a null value
in one of the date fields. Then this error is given:
"Cast from type 'DBNull' to type 'Date' is not valid. Do you want to
correct the value?"
2) What happens if you try and update where <both> dates are null. Same
error? or does it only happen when one is null?
It gives me the same error as it gives when one is null.
"Concurrency violation: the update command affected 0 records."
3) What constraint, if any, have you set up on these fields in the
database. Are they set to must-be-non-null? It's possible, perhaps, that
you are getting a misleading error message pointing you in the wrong
direction.
I haven't set up any constraints on these two fields in the database.
Their required field is set to 'No'(with Access terminology), they have
data/time data type with short time format.
4) Can you update new records in Access itself - ie. manually. If not,
does it give the same error message or something more useful?
In Access, I can update them manually without any error.
I hope I could explain the problem clearly. Please let me know if there
is anything not clear enough. Thanks for your time,
Reney
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!