Apologies if this is a no-brainer. I have googled myself silly and cannot find the answer.
I have a main form which serves as the main point of data entry for my database. It contains a couple of subforms which are bound to queries referring to whatever record is selected in the main form.
The subforms are continuous, allowing data entry and additions.
During normal use, a user will go through the main form, entering data in the fields and subforms. He/she may well jump between records on the main form adding and adjusting data as required. The record selector is therefore heavily used.
The problem is, that when the focus is on any field in a subform, trying to use the record selector results in an error along the lines of "you can't go to the specified record".
I have trained users to click on any field on the main form, and then try to use the record selector. The trouble is, this is a less-than-classy workaround on a database tool that otherwise works just fine. I am also worried that unnecessary clicking in fields increases the risk of keystroke errors.
Is there any way of forcing the record selector to only apply to the records of the main form? (even when the focus remains within the subform?).
You could try the following:
I assume that your record selector is a combo box or list box where selection is activated with a click or double-click.
First, unbind the main form from the table. Then, when you ckick on the selector, have it generate a query to select only the required record from the table, assign it to the tables rowsource and requery. in other words, at any given time, there is only a set of one record in the main form. The selector looks up the list of records and displays them, but the data in the selector is an unbound field and is used only to supply the parameter for the VBA query. Hence, it should remain independent of the main form/ subform relationship.
No, the record selector is the default MS access one that sits at the bottom of the form (image attached).
I was hoping to avoid coding my own version of this to jump between records, as apart from this one irritating feature, it is perfectly adequate for the needs of this database (the records are referred to by simple reference number).
Thanks for the correction. There is no code that relates to record navigation. The error presents itself in a simple 'ok' message box. It returns you to the form and allows you to carry on as you were. Clicking on any control in the main form puts the focus outside the subform, and allows the use of the navigation controls without issue.
Sounds like some kind of corruption to me. Are your Link Master and Link Child fields set correctly? I can't think of anything that would cause a codeless mainform/subform to throw that message other than corruption tbh.