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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am using VB 6.0 and an Access 200

Status
Not open for further replies.

Catrina

Programmer
Feb 11, 2000
70
US
I am using VB 6.0 and an Access 2000 database with ADO.

I am getting the error "Mutiple step operation genterated errors. Check each status value" when I try to enter a Null value in a date datatype field. I have the Field set to Not required.

How do I allow my users to clear a date?

Here is a sample of the code I am using:

rsAccess!TERMDT = text(15).text
rsAccess.Update

It was suggested that I try:

rsAccess!TERMDT = IIf(IsDate(Text(15).Text), CDate(Text(15).Text), vbNull)

but then I get the error "Type mismatch"

I even added the # but still same error

rsAccess!Hire = "#" & IIf(IsDate(Text(a%).Text), CDate(Text(a%).Text), vbNull) & "#"

Any ideas?

Thanks
Catrina

 
The error message is not what I would have expected for a problem
with null recordset fields, but assuming that the nulls are the problem,
(and it is true that you can't send an empty string using ADO and ODBC -
that's a statement, not a continuation of the earlier condition)

then one technique is to use a dummy date to represent a null in
your program. For example, if the user wants to clear a date or enter
an empty date, you test for that before doing the update. You assign
some date that for the program represents an empty date, for example
July 4, 1776, unless you are using a history database, then you would
select some other date that the user will never enter as a real date.
You store July 4, 1776 or whatever you pick, in the database. When
the records are read back from the database to the user, you first check
whether the returned date matches the dummy date, stored as a constant
in the program. If it matches, you display "" in the text field, and the user
is none the wiser.



Jim

oracle, vb, some javascript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top