I am in the middle of creating a multi-page data entry wizard consisting of a main form, tab control and several subforms. Navigation is by way of buttons on the main form. A 'Lock' button checks the data for completeness etc., and then locks the subform controls and enables the 'Next' button. Focus is moved to an insignificant Text Box ('txtSetFocusOnMe') control on the subform to enable/disable the buttons and allow locking.
Most of the subforms are single form but three are datasheets and here I am getting an Err 2164 ('You can't disable a control while it has focus') even though txtSetFocusOnMe is specifically exluded from the locking loop.
I must say I hate the inelegance of the adhoc 'txtSetFocusOnMe' approach, but have been unable to find anything better.
Does anyone have any idea how I can approach this problem? - it's driving me mad.
well, one way is to simulate datasheet view by way of formatting your form view so that it looks and feels like a datasheet, but works like a form under the hood.
Fact of the matter is, you need to move the focus somewhere and Access doesn't let you set the focus to nothing, which I consider a shortcoming. I generally set focus to some benign control, like the close button.
PS: If I am incorrect about the inability to set the focus to nothing, please let me know!
OK, I'll give it a try. But I've just 'remembered' that the subform control is just that - all that's needed is to set the control to locked and that's that, no looping, nothing . I'll blame it on the heat.