Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004
    the Netherlands

    Unanswered: Display table-contents in form

    Hi all,

    I'm creating a simple database with a form; the form is used to fill and/or view the contents of the records of the only table in the database.
    I've created a subform with datasheet view on the form, but that's only displaying the records which is shown in the form. But what I want is that this subform displays all records in the table, which enables me to easily scroll/browse through the records in the table and select the record of which I want to view the contents in the main form.

    It's probably a very easy question for you, but I can't make it happen...

    Thanks for your help!

  2. #2
    Join Date
    Mar 2004
    Berlin, Germany
    your kind of doin' it the wrong way. in general you would select the record in the main form and display the detail in the subform.
    but as you want to have a datasheet view you gotta do it the hard way :

    don't connect the main and the sub by "link child/master field".
    to control the main form from the sub you gotta put some code in the current event of the sub form
    with me.parent.parent
    .filter = .... (set ID-field of main to selected record of sub)
    .filteron = true
    end with

  3. #3
    Join Date
    Nov 2003
    Create a main form with 2 buttons on it call one form view and the other datasheet view. Place a sub-form on the main form and set the source object to the data sheet. In the OnClick event of the Form View button put this code:

    Me("My Subform Name").SetFocus
    Docmd.RunCmd acCmdSubformFormView

    In the Datasheet View put this code

    Me("My Subform Name").SetFocus
    Docmd.RunCmd acCmdSubformDatasheetView

    You can click either button to get the form view and the datasheet view

Posting Permissions

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