?
Solved

Error message when applying a filter

Posted on 2004-04-01
12
Medium Priority
?
1,050 Views
Last Modified: 2007-12-19
In Access 2000, I am building a db with a couple of command buttons that either apply or remove a filter on frmDataEntry.  By default, frmDataEntry is filtered by "Open" and Site "1"

If I click on the button to remove the filter (cmdRemove), then I receive the following error message:  Run-Time error '2766':  The object doesn't contain the Automation object 'GenUniqueID.'

My source table, tblData has a field calle lngID set as the primary key.  lngID is set up as an AutoNumber field, and it increments at random.

This db has been working fine for three weeks.  This error just started to appear yesterday afternoon.

I have tried to repar the db with no luck.  I have tried to recreate the form and import all of the code, and I have received the same results.

Any help will be greatly appreciated.

Thanks in advance,

krameje
0
Comment
Question by:Yoink
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 2
12 Comments
 
LVL 54

Expert Comment

by:nico5038
ID: 10735004
To remove a filter just use:

me.filteron = false

Nic;o)
0
 
LVL 54

Expert Comment

by:nico5038
ID: 10735016
BTW do you have changed this .mdb in a replica ?

Nic;o)
0
 
LVL 2

Author Comment

by:Yoink
ID: 10735059
Nico, here is the code I am using:

'***Code Start
Private Sub cmdRemoveFilter_Click()
Dim intMaxRecord, intCurrentRecord As Integer

'***Resets the recordcount caption
intMaxRecord = RecordsetClone.RecordCount
intCurrentRecord = Me.CurrentRecord
Me.lblRecordCount.Caption = "Record " & intCurrentRecord & " of " & intMaxRecord
       
Me.lblFilterApplied.Visible = False
Me.cmdAddRec.Enabled = True
Me.cboStatusFilter = Null
Me.cboQueueFilter = Null
Me.FilterOn = False '***This is where the break appears
Me.AllowAdditions = True
Me.Requery
Me.Repaint
DoCmd.GoToRecord , , acNewRec

End Sub
'***Code End

I have not created a replica of the db yet.  I was hoping to do that tomorrow.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:Yoink
ID: 10735089
Nico, if I click to continue the code, everything executes properly.
0
 
LVL 54

Expert Comment

by:nico5038
ID: 10735165
Strange, looks OK to me, what line does the "Run-Time error '2766'" message appear ?

BTW:
Me.Requery
Me.Repaint
Is more or less duplicate, one would do.

Nic;o)
0
 
LVL 51

Expert Comment

by:Steve Bink
ID: 10735172
If the error started popping up a couple weeks ago, there's only two sources for the error: corruption or a change in structure.

The error sounds like it is looking for an OLE Automation object called GenUniqueID.  Did you have this field in your table and you deleted it?  Does the form have a control bound to [GenUniqueID] without a matching field?

It may even be that without the filter, the recordset is moving to a record with an invalid value in that field...
0
 
LVL 54

Expert Comment

by:nico5038
ID: 10735209
Hi routinet, the GenUniqueID is added by access when you make a table suited for replication. It replaces the autonum field to uniquely identify a row in a table. (Just check the tablefield options for an autonumber)

Nic;o)
0
 
LVL 2

Author Comment

by:Yoink
ID: 10735278
Nico, the error appears on:  Me.FilterOn = False

routinet, the error started appearing yesterday.  There is no field on a table or control on a form/report called GenUniqueID.

I am wondering if it would be better to start a new db, import the objects into the db without code, then apply the code to all of the objects.
0
 
LVL 51

Expert Comment

by:Steve Bink
ID: 10735350
Indeed!  One more little fact I'll file away...I've never dealt with replication.  Is there a reason it would be looking for that field if the database has not been replicated?
0
 
LVL 54

Accepted Solution

by:
nico5038 earned 1000 total points
ID: 10735438
It's also a property of the autonumber you can set, but I guess we can have a corrupted database here.

My MS Access database recovery steps:

1) Create a backup of the corrupt database. (Just in case of)

2) Create a new database and use File/Get external data/Import to get all objects of the damaged database.

3) Try these Microsoft solutions:
Repair A97/A2000:
http://support.microsoft.com/support/kb/articles/Q109/9/53.asp
Jetcomp:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q273956
and/or read the article:
ACC2000: How to Troubleshoot Corruption in a Microsoft Access Database
http://support.microsoft.com/default.aspx?scid=kb;en-us;306204

4) Bit "heavier":
Access decompile:
http://www.granite.ab.ca/access/decompile.htm

5) Try a recovery tool:
Access recovery:
http://www.officerecovery.com/access/index.htm

6) Ask a company (will cost $$'s ! )
http://www.pksolutions.com/services.htm 

Nic;o)
0
 
LVL 2

Author Comment

by:Yoink
ID: 10735580
Thanks for the links, Nico.  All during development, I have been making backup copies of my db.  
0
 
LVL 2

Author Comment

by:Yoink
ID: 10741723
Excellent links, Nico!  Thank you for your help!
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

770 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