Intermittent "Type Mismatch" error...

missinglinq

AWF VIP
Local time
Today, 05:50
Joined
Jun 20, 2003
Messages
6,420
This is driving me nuts. I recently had to replace my hard drive. When I started working on my db I encontered problems
(not exactly unexpected).

Background:
When I "delete" a patient record it's not actually deleted, but rather has a checkbox called IsInactive that is selected on "deletion". This keeps the record from showing in the "Active Patient" form, but allows for the easy re-instatement of the patient at a later date (this is a fairly frequent event). A copy of the record is added to a Discontinued Patient table, to document the discontinuing of that patient's current case.

This part of the db has been up and running for six months without problems. I check the complete db, including all functions, at least once a week. After replacing my HDD I immediately installed Access2000 and started testing the db.
On trying to "delete" a record I got an "error 13" "type mismatch" message. Now obviously no data types had changed by simply placing a backup copy of the db on the computer after HDD replacement. The second line of the following sub was hilighted when I went into debug mode:

Private Sub DelRecord_Click()

DoCmd.SetWarnings False

DoCmd.OpenQuery "DeadMansAppend" 'Adds copy of record to permanent DC table (DCClients)

[PtIsInactive].Value = True 'Marks record as inactive

[ClientName].SetFocus
Me.Requery

DoCmd.SetWarnings True

End Sub


I finally put this problem aside and went about re-installing other software. After reloading Visual Basic 6, I took a break and then came back to my db and ran it again, an lo and behold, IT RAN JUST FINE!!

In fact it ran fine for three days, but now the above problem has recurred...intermittently!!! Sometimes it works fine, sometimes it doesn't. I've compacted and repaired the db without luck, and I've even used the documenter to print out the field properties for both tables. All the fields match up vis a vis type.

Any ideas? Thanks in advance for any help.

The Missinglinq

P.S. Please excuse any rambling, I've been running a temperature of 102F all wek.

"It's got to be the going,
not the getting there that's good!"
-Harry Chapin
 
You say >>>>>but allows for the easy re-instatement of the patient at a later date<<<<

Then in your code you have >>>>DoCmd.OpenQuery "DeadMansAppend"<<<<

This must be a good hospital!!!
 
You have to take your fun where you find it! The DeadMansAppend is actualy a table of "dead" or discontinued admissions, not patients.
 
Could be divine resuscitation!

Have you tried using the "Decompile” switch on your DB?
 
Thanks for the suggestion, Tony. I did the /decompile thing and once again the routine is working (for now). As it's been an on "again off again" thing, a couple or three days will tell the tale.

Thanks again for your input.

The Missinglinq
 
Thanks again, Tony, but /decompile didn't do it. Problem still persists. Anyone else with ideas?

The Missinglinq
 
Finally decided to open a new db and import everything into it. One table wouldn't import because of a "type mismatch" in a Default Value. Since there was only one DV in the table, tracking it down was easy. I rewrote the default value and everything's fine now. Still not sure why a program that's been up and running daily for six months suddenly decided to stop running over this issue, but I guess it's just one of those Access Mysteries.

The Missinglinq
 
ml,

Considering how many end-user applications there are in this
world, Access can be very, very unreliable. Databases can
"die" and only be reborn by importing into a new db. Forms
can go brain dead and have to be recreated. Reference
problems can come and go.

Back up early and often.

Wayne
 

Users who are viewing this thread

Back
Top Bottom