• Erratic Query (Access 2000_SR1)

    Author
    Topic
    #357759

    I am puzzled by the behaviour (or lack thereof) of a subform/query execution.

    Setting the stage:
    Form frmRailcars has four pages.
    On the form header is a combobox that allows for the selection of a railcar id.
    Page 1 displays general information about the railcar.
    Page 2 displays a list of the parts recovered from this railcar.
    It does this as follows:
    Page 2 contains a subform object which uses as its Data Source object a form called frmRecoveredParts which uses as its source a query that retrieves part_id,quantity and part_value. The selection criteria is the railcar id shown in the parent form combo box.

    When the frmRailcars’ cboCarID_AfterUpdate events executes, it locates the railcar record and populates the various text boxes on Page 1. It also executes the .Requery method which causes the subform on page 2 to be filled with a list of recovered parts.
    The subform uses for Master link field and Child link field the fldCarID .
    (This is where my mind ran off the tracks confused, and how I figured out how to make this convoluted system work will remain an enigma for me).

    The puzzle:
    When I call the frmRailcar form from the forms page of the Access interface, it displays the list of recovered parts just fine.
    But when I run the same form from a switchboard form button, it does everything except display the recovered parts list on Page2.

    This surprises me because I expected the only function of the switchboard to be the making of a call to the frmRailcar form. Nothing more, nothing less.
    I am wondering now if the name of the switchboard form also needs to be embedded in the query criteria somewhere, and if so, how would I make a reference to an hierachy of forms.

    Any help would be appreciated!

    Viewing 1 reply thread
    Author
    Replies
    • #532172

      I don’t think this is a query issue. I’ve found before in Access 97, that some forms simply will not work from a switchboard if they have subforms and subsubforms but they will work if opened directly. What I usually do in that case is create either a macro or a code routine that opens the form. Then I use a RunCode action on my switchboard to run the code (or a RunMacro to run the macro) that launches the form. That seems to get around the problem.

    • #532269

      Since your subform has the linking fields set to the car ID, try removing the selection criteria from the query.

    Viewing 1 reply thread
    Reply To: Erratic Query (Access 2000_SR1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: