Solved

Error message when applying a filter

Posted on 2004-04-01
12
1,045 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
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 50

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 50

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 250 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

735 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