Solved

Error message when applying a filter

Posted on 2004-04-01
12
1,043 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

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.

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
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 …

839 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