Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Open? Refresh? ReQuery? subform

Discussion in 'Information Technology' started by Bob Richardson, Nov 7, 2005.

  1. Bob Richardson

    Bob Richardson
    Expand Collapse
    Guest

    My form has a combobox and a subform. When I click a value in the combobox
    (ClassCodeCombo) I want a different record to appear in the SUBFORM.
    Instead, I get the correct record to appear in a brand new form which floats
    above the main form (with the old subform still visible). I guess this is
    obvious because I said "DoCmd.OpenForm" So my question is, what command do
    I want rather than OpenForm?

    Here's the VB from my OnCLick Event:

    On Error GoTo Err_EventBtn_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "ClassInfo"
    stLinkCriteria = "Classes.ClassCode='" & Me!ClassCodeCombo & "'"

    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_EventBtn_Click:
    Exit Sub

    Err_EventBtn_Click:
    MsgBox Err.Description
    Resume Exit_EventBtn_Clic
     
  2. Loading...


  3. David Lloyd

    David Lloyd
    Expand Collapse
    Guest

    Bob:

    One alternative is to use the Link Child Fields and Link Master Fields
    properties of the Subform (Data Tab). For the Link Master Fields property
    you can use ClassCodeCombo and for the Link Child Fields you can use
    [ClassCode].


    --
    David Lloyd
    MCSD .NET
    http://LemingtonConsulting.com

    This response is supplied "as is" without any representations or warranties.


    "Bob Richardson" <bobr at whidbey dot com> wrote in message
    news:BP-dnULl9vC1NvPeRVn-pQ@whidbeytel.com...
    My form has a combobox and a subform. When I click a value in the combobox
    (ClassCodeCombo) I want a different record to appear in the SUBFORM.
    Instead, I get the correct record to appear in a brand new form which floats
    above the main form (with the old subform still visible). I guess this is
    obvious because I said "DoCmd.OpenForm" So my question is, what command do
    I want rather than OpenForm?

    Here's the VB from my OnCLick Event:

    On Error GoTo Err_EventBtn_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "ClassInfo"
    stLinkCriteria = "Classes.ClassCode='" & Me!ClassCodeCombo & "'"

    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_EventBtn_Click:
    Exit Sub

    Err_EventBtn_Click:
    MsgBox Err.Description
    Resume Exit_EventBtn_Clic
     
  4. Bob Richardson

    Bob Richardson
    Expand Collapse
    Guest

    Thanks. It worked when I used [EvCode];[ClassCode] for the child, and
    EvCode;ClassCodeCombo for the master.

    Where can a read about the syntax for these properties? Like, why the child
    fields have {} around them, and the master fields don't?


    "David Lloyd" <David@NoSpamPlease.com> wrote in message
    news:DDIbf.44854$ty1.28680@bignews1.bellsouth.net...
    > Bob:
    >
    > One alternative is to use the Link Child Fields and Link Master Fields
    > properties of the Subform (Data Tab). For the Link Master Fields property
    > you can use ClassCodeCombo and for the Link Child Fields you can use
    > [ClassCode].
    >
    >
    > --
    > David Lloyd
    > MCSD .NET
    > http://LemingtonConsulting.com
    >
    > This response is supplied "as is" without any representations or
    > warranties.
    >
    >
    > "Bob Richardson" <bobr at whidbey dot com> wrote in message
    > news:BP-dnULl9vC1NvPeRVn-pQ@whidbeytel.com...
    > My form has a combobox and a subform. When I click a value in the combobox
    > (ClassCodeCombo) I want a different record to appear in the SUBFORM.
    > Instead, I get the correct record to appear in a brand new form which
    > floats
    > above the main form (with the old subform still visible). I guess this is
    > obvious because I said "DoCmd.OpenForm" So my question is, what command
    > do
    > I want rather than OpenForm?
    >
    > Here's the VB from my OnCLick Event:
    >
    > On Error GoTo Err_EventBtn_Click
    >
    > Dim stDocName As String
    > Dim stLinkCriteria As String
    >
    > stDocName = "ClassInfo"
    > stLinkCriteria = "Classes.ClassCode='" & Me!ClassCodeCombo & "'"
    >
    > DoCmd.OpenForm stDocName, , , stLinkCriteria
    >
    > Exit_EventBtn_Click:
    > Exit Sub
    >
    > Err_EventBtn_Click:
    > MsgBox Err.Description
    > Resume Exit_EventBtn_Clic
    >
    >
    >
     

Share This Page