Solved

Error message when applying a filter

Posted on 2004-04-01
12
1,040 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
  • 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now