Forum Discussion

HeinziAT's avatar
HeinziAT
Iron Contributor
Jun 03, 2026

Regression in v2605: Subform with overlapping controls breaks timer in unrelated form

I found another issue (sorry) which might be caused by the zoom-related changes in 2605. The following repro example works fine in 2604 (Monthly Enterprise Channel) but breaks in 2605 (Current Channel).

Again, this issue is unrelated to zooming itself.

Prepare database

The repro requires three forms and a few controls. Since those are tedious to get right manually, I wrote some VBA code to do that for us. Execute BuildRepro() in the Immediate Window to create the forms and controls.

Option Compare Database
Option Explicit

Public Sub BuildRepro()
    CreateFormASubform
    CreateFormA
    CreateFormB
End Sub

Private Sub CreateFormASubform()
    Dim frm As Form
    Dim ctl As Control

    Set frm = CreateForm()

    Set ctl = CreateControl(frm.Name, acTextBox, acDetail, , , 345, 1140, 1746, 260)
    ctl.TabStop = False
    
    Const textBoxTop = 260
    Set ctl = CreateControl(frm.Name, acTextBox, acDetail, , , 56, textBoxTop, 270, 270)
    ctl.TabStop = False

    Set ctl = CreateControl(frm.Name, acImage, acDetail, , , 56, 0, 270, 270)
    Set ctl = CreateControl(frm.Name, acCommandButton, acDetail, , , 60, 795, 5895, 260)

    SaveAndClose frm, "FormA_Subform"
End Sub

Private Sub CreateFormA()
    Dim frm As Form
    Dim ctl As Control
    
    Set frm = CreateForm()
    
    Set ctl = CreateControl(frm.Name, acSubform, acDetail, , , 100, 100, 3000, 3000)
    ctl.SourceObject = "FormA_Subform"
    
    SaveAndClose frm, "FormA"
End Sub

Private Sub CreateFormB()
    Dim frm As Form
    Dim ctl As Control
    
    Set frm = CreateForm()
    frm.TimerInterval = 1
    
    Set ctl = CreateControl(frm.Name, acLabel, acDetail, , , 100, 100, 5000, 1000)
    ctl.Name = "my_label"
    ctl.Caption = "Waiting for Timer..."
    
    frm.HasModule = True
    frm.Module.InsertText _
        "Private Sub Form_Timer()" & vbCrLf & _
        "    Me.TimerInterval = 0" & vbCrLf & _
        "    Me.my_label.Caption = ""Done""" & vbCrLf & _
        "End Sub"
    frm.OnTimer = "[Event Procedure]"

    SaveAndClose frm, "FormB"
End Sub

Private Sub SaveAndClose(ByVal frm As Form, ByVal newname As String)
    Dim oldname As String
    
    oldname = frm.Name
    DoCmd.Save acForm, oldname
    DoCmd.Close acForm, oldname
    DoCmd.Rename newname, acForm, oldname
End Sub

 

Run repro

1. Open FormA.

2. Open FormB (while FormA is still open).

Expected result: FormB opens completely, the timer runs and the label reads "Done".

Actual result: FormB opens "halfway" (it's visible, but it's tab is still missing, see screenshot below) and the label still shows "Waiting for Timer...". As soon as you right-click anywhere, the form finishes opening and the timer runs, changing the label to "Done".

Notes:

  • I tried to make the repro as simple as possible. If you remove one of the controls from FormA_Subform (or enable TabStops), the problem disappears.
  • It might have something to do with overlapping controls: If you change textBoxTop from 260 to 280, so that it no longer overlaps with the image, the problem also disappears.
  • We need the overlapping controls because in our real code the subform is continuous and displays data at different indentation levels (like a treeview).

6 Replies

  • Thank you. I tested your very clear and well constructed repro in the latest CC version 2605 build 20026.20140 and it gave the expected result "Done" rather than the issue you described. I tested using both tabbed documents (where I could only see part of Form A) and with overlapping windows (where Form A was fully visible). I believe Karl has been able to reproduce this problem but for whatever reason I didn't experience it. 

    UPDATE:

    Just re-tested on another Win 10 machine with 365 version 2606 20131.20000 Beta Channel 64-bit.

    This time I do see the Waiting for Timer issue you reported. I can’t show that as a screenshot as clicking anywhere on the ribbon causes the code to immediately complete and show Done. Similarly so does clicking the Snipping Tool to do a screengrab

    • HeinziAT's avatar
      HeinziAT
      Iron Contributor

      Thank you! My test system is a Windows 11 VM with 365 20026.20140 Current Channel 32-bit.

      Yes, there are a few ways to "trigger" completion: Right-clicking is one of them (works only in non-runtime mode, where you actually have a context menu), clicking on the form tabs is another one (also works in runtime mode).

      Regarding the screenshot: If you start the full version of the Windows Snipping Tool (via start menu rather than via Win-Shift-S), there's a "Delay" option in the tool bar. That's very useful for taking pictures of such "brittle" UI issues where operating the snipping tool itself can interfere.

      • MendipDataSystems's avatar
        MendipDataSystems
        Brass Contributor

        Thanks for the reminder about the delay options in the Snipping Tool. I used it a lot in the older (and in many ways better) snip and sketch for showing drop downs etc, but forgot about it here.