
420 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
From a form, if in the event of a button click, we open a 2nd form followed by the invalidate command from the ribbon, the checkboxes or togleButton lose their selected state.
Here is the test VBA code:
Private Sub cmdOpenForm_Click()
'If Not rbForm1 Is Nothing Then rbForm1.Invalidate ' <=== Here too, it's the same problem
DoCmd.OpenForm "Form2"
If Not rbForm1 Is Nothing Then rbForm1.Invalidate
End Sub
Here is the XML code for the ribbons:
<customUI onLoad="rbForm1_OnLoad" xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="true">
<tabs>
<tab id="tabInfo" label="Form1">
<group id="grpClose">
<button idMso="MasterViewClose" size="large"/>
<checkBox id="checkBox1"/>
<toggleButton id="toggleButton1" label="Test" size="large" imageMso="About"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI
Here is the process:
After this process, the checkBox is unchecked and the togleButton is released.
Here is an illustration:
if the line of code If Not rbForm1 Is Nothing Then rbForm1.Invalidate in VBA is removed, the problem does not exist.