Can't remove old form filter command in Design Mode (1 Viewer)

GK in the UK

Registered User.
Local time
Today, 19:58
Joined
Dec 20, 2017
Messages
274
I've ended up in a situation where my form seems to be 'stuck' with a filter and I can't get rid of it.

I've got a form which has a sub form TransLineLedger.
The column headings have the drop down arrows to filter on the contents.

I also built in one filter on a command button but it seems to intefere with any other filters that are set with the drop-down arrows. The filter was on thPostingBatchNo which is a visible column in the sub form.

I commented out the code for the button that sets the filter. Opened the sub form in design mode, and cleared out the filter and re-saved. So I can't see my command button filter command anywhere in the form design.

Now when I open the form and click on a different filter (a date filter, say) Access pops up a message 'The object doesn't contain the Automation object 'thPostingBatchNo'.

How do I permanently remove the old command button filter so I don't get the error message ?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:58
Joined
Oct 29, 2018
Messages
21,469
Hi. Perhaps you could try decompiling the project and then recompile it.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:58
Joined
May 21, 2018
Messages
8,527
Maybe I missed it, but in design view is there anything in the filter property? If you delete the text will it come back?
If you set a filter in code it becomes part of the filter property. If for a reason before saving the updated form and you go into design view you can end up persisting this property. Normally if you do not have to switch into design view then it will not persist.
 

GK in the UK

Registered User.
Local time
Today, 19:58
Joined
Dec 20, 2017
Messages
274
Tried the decompile, c&r, still getting the message.

So here's what I'm seeing:
Open the main form with a record in the normal use way, ie, app is running.
Main form has 2 tabs, one is TransLineLedger.
No Filter is selected (I can see the funnel with the x and it says No Filter)
Datasheet shows all records.
Drop down the Date filter, uncheck all bar one, get the error message. Now says 'Filtered'
So the filter has worked but the message is spoiling it.

Close form, repeat but this time instead of picking a date filter I go to Design Mode. But there's nothing I can do there because the filter is on the sub form.
So I go to the sub form TransLineLedger, straight into design mode. 'Filter' is empty, nothing there at all. 'thPostingBatchNo' doesn't appear to exist anywhere in properties.

Repeat, apply date filter, Access complains 'The object doesn't contain the Automation object 'thPostingBatchNo'.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:58
Joined
Oct 29, 2018
Messages
21,469
Tried the decompile, c&r, still getting the message.

So here's what I'm seeing:
Open the main form with a record in the normal use way, ie, app is running.
Main form has 2 tabs, one is TransLineLedger.
No Filter is selected (I can see the funnel with the x and it says No Filter)
Datasheet shows all records.
Drop down the Date filter, uncheck all bar one, get the error message. Now says 'Filtered'
So the filter has worked but the message is spoiling it.

Close form, repeat but this time instead of picking a date filter I go to Design Mode. But there's nothing I can do there because the filter is on the sub form.
So I go to the sub form TransLineLedger, straight into design mode. 'Filter' is empty, nothing there at all. 'thPostingBatchNo' doesn't appear to exist anywhere in properties.

Repeat, apply date filter, Access complains 'The object doesn't contain the Automation object 'thPostingBatchNo'.
Are you able to share a copy of your db showing the problem?
 

GK in the UK

Registered User.
Local time
Today, 19:58
Joined
Dec 20, 2017
Messages
274
DbGuy, the project is just too big with too many interactions to upload.

Still haven't figured it out. I rebuilt the sub form from scratch. But I should have remembered that the very same sub form is re-used in a different host form. So having rebuilt it, I have exactly the same behaviour for one of the host forms but on the other host form I don't get the error. So I need to look at the code in the host form but I don't see how clicking the filter drop-down (which is on the sub form) throws an error when it is hosted in one form but not in the other.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:58
Joined
Oct 29, 2018
Messages
21,469
DbGuy, the project is just too big with too many interactions to upload.

Still haven't figured it out. I rebuilt the sub form from scratch. But I should have remembered that the very same sub form is re-used in a different host form. So having rebuilt it, I have exactly the same behaviour for one of the host forms but on the other host form I don't get the error. So I need to look at the code in the host form but I don't see how clicking the filter drop-down (which is on the sub form) throws an error when it is hosted in one form but not in the other.
Are you able to share your screen then (TeamViewer, Zoom, Chime, Google Meets, GoToMeeting etc.)?
 

GK in the UK

Registered User.
Local time
Today, 19:58
Joined
Dec 20, 2017
Messages
274
Here's the error message. The sub form with the funnel 'Account' is used in two forms and only one throws the error. It's as though 'thPostingBatchNo' has got coded into the host form somehow but I can't see where. Is there an event that fires when I set the drop-down filter? The filter sets and filters the sub form (as you can see here I selected to filter just one account). I *was* setting thPostingBatchNo filter in code but not anymore.

screenshot.jpg
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:58
Joined
Oct 29, 2018
Messages
21,469
Here's the error message. The sub form with the funnel 'Account' is used in two forms and only one throws the error. It's as though 'thPostingBatchNo' has got coded into the host form somehow but I can't see where. Is there an event that fires when I set the drop-down filter? The filter sets and filters the sub form (as you can see here I selected to filter just one account). I *was* setting thPostingBatchNo filter in code but not anymore.

View attachment 82649
Hi. I meant can you share your screen? You know, using a screen sharing app?
 

GK in the UK

Registered User.
Local time
Today, 19:58
Joined
Dec 20, 2017
Messages
274
Ah, sorry, no don't want to do that. I know it's hard making a diagnosis at a distance. I haven't solved this problem yet but I'm posting a related question.
 

GK in the UK

Registered User.
Local time
Today, 19:58
Joined
Dec 20, 2017
Messages
274
Got it fixed but can't explain it. I had two fields on the main form which showed totals from the sub form footer. Deleted them and found I could filter the sub form without the Access Automation error. Put them back one at a time, with the same names and data source syntax, and the form is fixed.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:58
Joined
Oct 29, 2018
Messages
21,469
Got it fixed but can't explain it. I had two fields on the main form which showed totals from the sub form footer. Deleted them and found I could filter the sub form without the Access Automation error. Put them back one at a time, with the same names and data source syntax, and the form is fixed.
Hi. Congratulations! Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom