Solved

ACcess 2003 Corrupted data (nothing helps)

Posted on 2013-10-24
12
259 Views
Last Modified: 2013-10-24
My Access db has legacy tables from my client, but one of them has corrupted data. I've tried everything I can think of: (1) Exported into a clean db, (2) Used query to make a  table from the original one. Nada.

I have one combo box filtered by the value in another. But the filtered one does not recognize the values in the 1st box. Instead of using the Forms![frm]![object] to refer to the first box , I even put a number in the filter expression of the 2nd box. Still doesn't recognize the value.

I'm embarrassed to admit how many hours went down the drain before I realized it was the data.
0
Comment
Question by:ms3930
  • 5
  • 4
  • 2
  • +1
12 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 39596680
Do the values in the 'corrupted' table look like normal alphanumeric values or do they look odd, like hieroglyphics (indicating corruption)?


If the values look normal, it could be that the data contains leading/trailing spaces or invisible control characters such as line feeds, etc that are preventing your criteria/comparisons from matching up where you would expect.  If this is the case, you can run an update query to clean up the data once you identify what characters need to be removed.

Can you post a sample database containing just the relevant tables wirh some of this data and the form/combo boxes you are working with?  Mask or remove any sensitive data before uploading the sample.
0
 
LVL 57
ID: 39596875
1. Make a copy of the DB.

2. On the copy, remove all indexes on the problem table.  Also remove all relationships.

3. Create a fresh DB.

4. Import the tables, with structure and data, expect for the table in question.

5. Import the problem table, but with *structure only*

6. Link to the problem table in the new DB to the old corrupted DB.

7. Create an append query to move the records in chunks.

  You may have to repeat this several times to narrow things down to the record(s) that are causing problems.

With all that said, on this:

<< I even put a number in the filter expression of the 2nd box. Still doesn't recognize the value.>>

 Does the rowsource the combo use display data correctly on it's own? Is it set to the table directly or does it use a query?

Jim.
0
 
LVL 1

Author Comment

by:ms3930
ID: 39597908
Just an update on your comments:

1. The data looks normal. No gibberish.
2. The rowsource uses a SQL statement within the control (no separate query)
3. If there are bad characters in the data, it's tough to identify them

I am am now trying the procedure suggested by MDettman.

I have also attached a file. When you open the form, and select an office, the "Agents" box populates correctly. When you do it a second time, the data does not change. Strange, huh?
MS3930-UploadFile.zip
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 39598025
It might be that the form is corrupted, not the data.  Try making a brand-new form and see if the combo box works correctly.
0
 
LVL 1

Author Comment

by:ms3930
ID: 39598155
Not the form. Created several.
0
 
LVL 57
ID: 39598334
Your attached file link in the above doesn't work for some reason.  Please upload it again.

Thanks,
Jim.
0
 
LVL 1

Author Comment

by:ms3930
ID: 39598523
Here's the file.
MS3930-UploadFile.zip
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39598637
Your data looks fine.

You just need to requery your Agent combo box to refresh the list after selecting an office:

Private Sub cboOffice_AfterUpdate()
cboAgent.Requery
End Sub

Open in new window

0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39598654
It looks like you tried to do that, and were actually very close... but you put the requery statement in the wrong event.  It was in the AfterUpdate event of the Agent combo, but should have been in the after update event of the Office combo.
0
 
LVL 1

Author Comment

by:ms3930
ID: 39598684
I thought I had put it in the Afterupdate event of he office box. Anyway, when you all made that change, did it work correctly? Remember, it works when you make the first selection, but not after that.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39598854
Did you try making that change yourself?  Note that you cant simply change the name of the sub in the code - it won't automatically connect to the right event procedure.  You need to make sure the words "Event Procedure" are showing in the box next to After Update in the property sheet.  Clicking the "..." and choosing Code Builder automatically makes that connection for you; editing an existing event procedure does not.

< Anyway, when you all made that change, did it work correctly?>
Anyhow it does appear to be working correctly.  Here's the sample with that change in it:
MS3930-UploadFile.mdb
0
 
LVL 1

Author Comment

by:ms3930
ID: 39599555
The solution was actually in two steps:

1. The requery was in the wrong spot (an amateurish error)

2. The data was tainted. So I migrated it into clean tables, which I recreated manually, and then used DAO & recordsets to save it in the new ones.

Thank you for your timely help.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question