Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2008
    Posts
    3

    Unanswered: Binding record selector to main form

    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?).

    Noob-tolerance much appreciated.

  2. #2
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    Posts
    201
    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.

  3. #3
    Join Date
    Oct 2008
    Posts
    3
    Thanks for advice.

    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).
    Attached Thumbnails Attached Thumbnails Record selector copy.jpg  

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    BTW, those are record navigation buttons, not record selectors. The record selector is the vertical grey bar which has an ► or a *in it.

    When you get the error, do you get the chance to DEBUG and look at which line of code it is... or is there no code at all?

    If there is no code, the error shouldn't be happening and perhaps a Compact and Repair is in order.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  5. #5
    Join Date
    Oct 2008
    Posts
    3
    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.

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    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.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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