X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Docmd.openform Wherecondition Stopped Working!, Access 2003    
post May 13 2017, 12:01 PM

Posts: 45
Joined: 18-January 16

I recently saved an .accdb file as a .mdb one because for compatibility with some computers. Almost smooth, except that now EVERY Form that gets opened with a DoCmd.OpenForm ignores the WhereCondition (numeric field) and instead proceed to open the form without its data filtered at all.

If I press the Filter button in the lower bar, or if I set a command button so it sets the FilterOn property to true, it does show the desired record. However, if I try to set up the FilterOn property in the Load event, it gets ignored.

Was working fine before when it was an .accdb file.

As requested, I had to set the following properties on every form

Modal = True
Popup = True
Moveable = False
AutoCenter = True

Is there a reason for the FilterOn property to reset to false despite being a WhereCondition in the DoCmd.OpenForm method?
Go to the top of the page
post May 13 2017, 01:03 PM

Posts: 4,312
Joined: 11-November 02

Might help if we could see the actual code you're using.

Also, does other code in the app execute?

Is this on some machines or all machines?

Linq ;0)>
This post has been edited by missinglinq: May 13 2017, 01:04 PM

Hope this helps!

The problem with making anything foolproof...is that fools are so darn ingenious!

All posts/responses based on Access 2003/2007
Go to the top of the page
post Today, 10:49 AM

Posts: 45
Joined: 18-January 16

Bumping this just because I finally identified the culprit and wanted to share.

The OnOpen event had a procedure firing which would lock certain controls and put the RecordsetType property to 2 (Snapshot) to prevent unauthorized users from altering the data either through data or buttons which alter the info.

Either one of those two procedures (looping through the controls or changing the recordsettype) silently changes the FilterOn property to false. So all I had to do is set it again to true after that in the code as the last action of the event to restore it to normal.

Maybe it helps users who stumble upon it.
Go to the top of the page

Custom Search
RSSSearch   Top   Lo-Fi    22nd May 2017 - 08:09 PM