Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2004

    Unanswered: My subforms are making me crazy

    Subforms are making me crazy....

    I have this database that have several forms. The forms with subforms where the main form is linked to a table are working fine.

    But when the main form is linked to a query the subforms shows all the data. The link child and link master fields for the subforms are correct, but is not working for some reason.

    The queries that my main form is linked to are very simple and working fine. I basically have selected a couple of fields to "is null", and in some cases I use the "not like *name".

    Does anyone know why this is. Can I use something else than a query to select records for the form?

    Please help!!!

  2. #2
    Join Date
    Apr 2004
    Sydney Australia
    Queries are fine for MainForm/Subform link.

    There will be something wrong with the "linking" you are using.

    Bascically, a sub form is like opening a form with say a macro or code that runs OnCurrent. In other words it is like saying "please open the form for me where all the records in Field XYZ are the same as FieldXYZ on my MainForm"

    If you were link with something like LastName then when you came to Smith or Brown in your MainForm then the subform would disppaly all of the records with Brown.

    If you don't have some sort of ID Number field and have to use Name then you should in a query create a new field like this:

    NewField:[FirstName] & " " & [LastName] or similar and then this can become your linking field.


  3. #3
    Join Date
    Oct 2003
    Post your db and someone will take a look at it. Looks like you are missing something in your linking and it will be tough to guess what could be wrong without first looking at the form.

  4. #4
    Join Date
    Jul 2004
    I think I got it to work.

    I put the following in the on current event in my main form.

    Private Sub Form_Current()
    SubMaterial.SourceObject = "SubMaterial"
    End Sub

Posting Permissions

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