Results 1 to 5 of 5
  1. #1
    MatthewGrace is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    159

    Did I find a bug or do I just have my head up ...


    I'm attaching a super simple file demonstrating what I think may be a bug. Wouldn't surprise me if everyone knew but me.

    Open Form 1: press the button to launch DoCmd.OpenForm "Form2".... Where clause opens where [ID]=2
    Form2_Load fires: Msgbox me![field1]

    Everything works just fine. Form 2 correctly loaded via the filter and the Messagebox reflects that.

    Now, go into the code module for Form2 and change ANYTHING. maybe add a comment or something. Now rerun this experiment starting in Form1. You'll notice that while Form2 loads up filtered correctly, the msgbox returns unfiltered data from the first record in the table. close the form and try again and everything works fine. The bug only procs the first time running after a code module change on the called form.

    am I missing something?

    Note: I discovered part of the reason - When the glitch occurs as a result of the code module aleration above, the visual Form will appear to have its .FilterOn = True as it should be, but it's actually still false when the MsgBox is firing. Only after the Form is visibly displayed does Access get its act together and apply the filter. So the _Load event is still playing with unfiltered data.
    mattDatabase201.accdb

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    I don't get that behavior. The message box still shows "Rec2 Field1"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    MatthewGrace is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    159
    Hm. I'm getting it here...
    bug demo.zip

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    After doing the edit you are leaving Form2 in DesignView. Close and save the form and its edit. Then click the button.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    MatthewGrace is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    159
    I did not see why I had to save/close (even if no code changes were made) in order for it to appropriately turn on the FilterOn property, although it definitely works. Alternatively, I could just type .FilterOn = true manually in the Code module to ensure it was applied.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. soccer table head-to-head query
    By sgramesh75 in forum Queries
    Replies: 2
    Last Post: 03-29-2017, 11:09 PM
  2. in Way over my head HELP
    By 91hrdbdy in forum Programming
    Replies: 8
    Last Post: 11-26-2013, 01:06 PM
  3. Head Scratcher.
    By Shido151 in forum Access
    Replies: 1
    Last Post: 04-03-2012, 01:25 PM
  4. Noob in way over his head, pls help
    By custhasno in forum Access
    Replies: 8
    Last Post: 10-12-2011, 02:33 AM
  5. In over my head
    By TylerB in forum Access
    Replies: 2
    Last Post: 05-04-2011, 04:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums