hello,
i've searched this forum for a sollustion but didn't find any. Here's my problem and some info about the actions:
1 - I have a continuous subfrm called 'FrmHfdPersUit' that has 2 buttons 'nieuw' (on subfrmheader) and 'bewerk' (in cont.form) and some textboxes which can not be selected (locked = true and enabled = false - off course setfocus wont work on these textboxes)
2- when the headform (called 'hoofdform') is editable the 2 buttons will be enabled. but when the headform is readonly (allowedits = false) the 2 buttons in the subfrm needs to be set 'enabled = false'
---> here occurs the error: 2164 cannot disable a control that has the focus
Debug lets me see that the first buttoncode 'nieuw.enabled = false executes but the second button 'bewerk' not.
Obviously access always needs one control on all forms where he can set a focus on because the focus is on a textbox (called datum_pv) on the headform.
Is there any chance that i can still disable the two buttons and leave the textbox properties as they are? Or do i have to set a transparent button without any code behind it to set the focus on? (don't like that
)
I hope someone has an other solution for this?
i've searched this forum for a sollustion but didn't find any. Here's my problem and some info about the actions:
1 - I have a continuous subfrm called 'FrmHfdPersUit' that has 2 buttons 'nieuw' (on subfrmheader) and 'bewerk' (in cont.form) and some textboxes which can not be selected (locked = true and enabled = false - off course setfocus wont work on these textboxes)
2- when the headform (called 'hoofdform') is editable the 2 buttons will be enabled. but when the headform is readonly (allowedits = false) the 2 buttons in the subfrm needs to be set 'enabled = false'
---> here occurs the error: 2164 cannot disable a control that has the focus
Debug lets me see that the first buttoncode 'nieuw.enabled = false executes but the second button 'bewerk' not.
Obviously access always needs one control on all forms where he can set a focus on because the focus is on a textbox (called datum_pv) on the headform.
Code:
....
Me.SetFocus
Me.Datum_pv.SetFocus
With Me.FrmHfdPersUit.Form
.Nieuw.Enabled = False
.Bewerk.Enabled = False
End With
....

I hope someone has an other solution for this?