vba - Trouble with SetFocus property and SubForms in Access -
i have mainform 4 other subforms on it. these subforms visible , invisible based on user selection on main form. visible/invisible works charm having problem setting focus on these subforms. doing:
on alter event of combobox makes subform visible, wanted set focus on form kept getting runtime 2110 error. noticed because fields on main form required fields , access not transfer focus unless these fields filled (setfocus worked when fields filled in main form). fill fields before going subform counterintuitive because not how info entered flowing.
so question ----- how allow focus transfer subform before having fill out required fields in mainform!?
all help highly appreciated always! thanks!
imho not possible if main form bound recordsource. whenever access moves focus away form it's default behaviour save changes if there any. hence want valid record (i.e. no changes or valid changes).
if subform record has recordsource foreign key relationship recordsource of main form need pk of main form have been created - serial generated on save. if not have record, not have pk pass on fk.
alas, if there no relationship between main form , subforms (i.e. don't need pk), possibility create main form unbound , save it's contents via button click in order allow users come in half of info before switching subforms.
of course of study have handle case of users inserting info in subforms , not finishing fields on main form.
vba access-vba ms-access-2007 ms-office setfocus
No comments:
Post a Comment