Solved

Error message when applying a filter

Posted on 2004-04-01
12
1,047 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
Industry Leaders: 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 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

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
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

738 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