Hello.
Beginner using accdb2010 with multiple forms for display only (eventually in runtime with maximum restrictions).
Have FrmSubNav on each main form with command buttons.
These buttons allow selection of another form or closing current form and returning to home form.
(The appropriate button colour and text is changed for each main form to identify its changed properties)
Problem = the OnClick is erratic.
Example for one button on FrmSubNav =
There is also a basic error msgbox removed from this example.
When viewing FrmWDYpages the button will close this form and open FrmHome . But if using the same button from a different form it will "hide" the calling form and open FrmWDYpages.
It is the second scenario that sometimes fails.
I get sent to FrmHome instead of the form called by the click.
No error box displayed.
I have been unable to successfully reproduce the failure - it seems to be random.
Speed of mouse click can sometimes prompt the failure (fast).
Success almost always with a second attempt (more deliberate / slow)
Calling form is "hidden" during this failure and FrmHome visible.
Wireless mouse / WinXPpro / <40% RAM usage / dualcore total at between 4% and 15% when clicking between forms.
Should I be using MouseDown/Up ? And if so - how to split code ?
Should the If statement be inverted to IsLoaded False then open with the Else option to do the Close, Open, SetFocus as the second part ?
Thank you.
Beginner using accdb2010 with multiple forms for display only (eventually in runtime with maximum restrictions).
Have FrmSubNav on each main form with command buttons.
These buttons allow selection of another form or closing current form and returning to home form.
(The appropriate button colour and text is changed for each main form to identify its changed properties)
Problem = the OnClick is erratic.
Example for one button on FrmSubNav =
Code:
Private Sub Button08_Click()
If CurrentProject.AllForms("FrmWDYpages").IsLoaded = True Then
DoCmd.Close acForm, "FrmWDYpages", acSaveNo
DoCmd.OpenForm "FrmHome", acNormal, "", "", , acFormReadOnly
Forms.FrmHome.Focus1.SetFocus
Else
Screen.ActiveForm.Visible = False
DoCmd.OpenForm "FrmWDYpages", acNormal, "", "", , acFormReadOnly
Forms.FrmWDYpages.Focus8.SetFocus
End If
When viewing FrmWDYpages the button will close this form and open FrmHome . But if using the same button from a different form it will "hide" the calling form and open FrmWDYpages.
It is the second scenario that sometimes fails.
I get sent to FrmHome instead of the form called by the click.
No error box displayed.
I have been unable to successfully reproduce the failure - it seems to be random.
Speed of mouse click can sometimes prompt the failure (fast).
Success almost always with a second attempt (more deliberate / slow)
Calling form is "hidden" during this failure and FrmHome visible.
Wireless mouse / WinXPpro / <40% RAM usage / dualcore total at between 4% and 15% when clicking between forms.
Should I be using MouseDown/Up ? And if so - how to split code ?
Should the If statement be inverted to IsLoaded False then open with the Else option to do the Close, Open, SetFocus as the second part ?
Thank you.