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!

Problem with Conversion

Status
Not open for further replies.

vellakaran

Programmer
May 22, 2003
9
CA
Hi, here is the problem. I just recently converted an Access 97 front end app to Access 2002. Everything is working fine except for one form. When I add a record via the form and either tab off the last field or choose another page the app crashes. I get a Microsoft error message saying, "Microsoft Access has encountered a problem and needs to close..." I've sent the error message in and followed the links but there is no specific answer to the problem other then to install SP-1, which I already have. When i re-open the app and go back to the form the data is there, it is not being lost.

Here is some background info: using XP professional Version 2002; Microsoft Access 2002(10.2627.3501) SP-1. The app is linked to SQL Server 7.0 backend tables. The table in question has 6 fields, 3 PK's and the datatypes are: text, date/time, number and yes/no. This is the only form that this is happening on and the app has several forms. I have tried re-linking the tables, re-creating the form, deleting the controls that accept data one by one to see if one is causing the error, but none of this has worked. I tried doing the conversion over and my second and third tries have produced the same error.

Any thoughts as to why this may be ahppening or has anyone ecountered a similar problem. Any help would be greatly appreciated.

VK

 
Dear VK,

You never mentioned compiling the database.

You need to do this in newer versions of Access when ever you import or copy forms, modules or reports that have code.

So, open a form, go to code window, select Debug and Compile.

Note you must get a clean compile for everything to be good.
Also under Tools >References check and make sure all references (Checked) are ok.

Hopefully, this will solve your problem.

Hap [2thumbsup]


Access Developer [pc] - [americanflag]
Specializing in Access based Add-on Solutions for the Developer
 
ok here is some more info. compiled the database and get a clean compile but still the same error. put code in the BeforeUpdate() and AfterUpdate() events. stepped through and it gets to code in BeforeUpdate() and then once it comes out of that sub i get the generic microsoft access error. i also have my own error routine coded for this form and it does not get to this code. i also ran the query that the form is based on separately and i get no errors. i can also manually insert to this table through my SQL Analyzer. it seems to be an anomaly, as this is the only form out of 30+ forms where i can enter data to, that this error is happening. will i just have to live with this??
 
VK,

I missed the part about SQL Backend,

So, here is just something to try.

1) Delete the links to any SQL Tables that are involved with this form and it's query.
2) Now Add the links as new (Not refresh)

Why, well if changes are made to keys in the backend and it is linked and SQL, well Access may not see those changes.

Also, examine the keys in question and make sure that they are defined the same as tables taht do work ok.

Hope You Find Your Problem,
Hap...

Access Developer [pc] - [americanflag]
Specializing in Access based Add-on Solutions for the Developer
 
ok here is what i found. for the date/time field, which is part of the key, it is a field that is set by the backend database, it does not appear on the form. i put it on the form and gave it a default value of Date(). everything is ok, i can now insert a record and the program does not crash. i then set the default property to Date() & Time() and the program bombs. (Although it still saves the info to the db.) It appears not to like the Time part of the date. talked to dba about it and the fields are of the same datatype so....decided just to use Date() as part of the primary key. not the best solution but we'll see.

thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top