Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Winnipeg, Canada
    Thanked 0 Times in 0 Posts

    Erratic Query (Access 2000_SR1)

    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 <img src=/S/confused.gif border=0 alt=confused width=15 height=20>, 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!

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Sacramento, California, USA
    Thanked 1 Time in 1 Post

    Re: Erratic Query (Access 2000_SR1)

    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.

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Crystal Beach, FL, Florida, USA
    Thanked 40 Times in 39 Posts

    Re: Erratic Query (Access 2000_SR1)

    Since your subform has the linking fields set to the car ID, try removing the selection criteria from the query.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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