Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2002
    Location
    Cornwall, UK
    Posts
    18

    Unanswered: Locking controls in datasheet subform

    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.

    Thanks.

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    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.

    good luck,
    tc


    PS: If I am incorrect about the inability to set the focus to nothing, please let me know!

  3. #3
    Join Date
    Mar 2002
    Location
    Cornwall, UK
    Posts
    18
    Thanks tc.

    I'm sure that Access always requires focus on an object - wouldn't 'Nothing' as an abstract object be useful!

    I've never tried creating a synthetic datasheet. Do you mean using a continuous form?

  4. #4
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    I've never tried creating a synthetic datasheet. Do you mean using a continuous form?
    exactly!

  5. #5
    Join Date
    Mar 2002
    Location
    Cornwall, UK
    Posts
    18
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •