Parameter Pop-up when changing subform

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • stevenrec

    Parameter Pop-up when changing subform

    Hi,
    guess I am overlooking something,
    using a list, I change what info is displayed on a form that has 3
    subforms.
    after selecting the topic to display, the subform names and links are
    read from a table, then the master form is updated using the info

    'all values = string variable
    Me.Sfrm_3.Sourc eObject = form_3
    Me.Sfrm_2.Sourc eObject = form_2
    Me.Sfrm_1.Sourc eObject = form_1
    Me.Title_1.Capt ion = form1_txt
    Me.Title_2.Capt ion = form2_txt
    Me.Title_3.Capt ion = form3_txt
    Me.Sfrm_3.LinkM asterFields = Link_2_Parent
    Me.Sfrm_3.LinkC hildFields = Link_2_Child
    Me.Sfrm_2.LinkM asterFields = Link_1_Parent
    Me.Sfrm_2.LinkC hildFields = Link_1_Child

    my problem is it keeps asking through pop-up windows the parameter for
    the last used link-field data.
    have tried setting linkchildfield and parent to null or nothing or ""
    before the update.
    It works fine if I just hit enter each time, the info is correct in
    the end, but apparently the links are still there during the change
    over.

    what do I need to add to be able to change the subforms and link-
    fields on an open form without the popup parameter windows?

    thanks
  • Albert D. Kallal

    #2
    Re: Parameter Pop-up when changing subform

    I seen this problem.

    Try:
    Me.Sfrm_3.Sourc eObject = form_3
    Me.Sfrm_3.LinkM asterFields = ""
    Me.Sfrm_3.LinkC hildFields = ""

    So, right after you assing the form object, kill the link master/child...

    I also found that if I modify the sub-forms sql direct, then again, I had to
    go:

    Me.subTourFrien ds.Form.frmTour Buses.Form.Reco rdSource = strSql
    Me.subTourFrien ds.Form.frmTour Buses.LinkChild Fields = ""
    Me.subTourFrien ds.Form.frmTour Buses.LinkMaste rFields = ""

    It's been awhile since I've done this, but if my memory serves me correct
    the problem was that if you have a relationship setup in the tables, MS
    access tries to do you a favor and sets the link master child for you based
    on those relationships (and that's not necessary what you want).

    In my above example, note how I had to kill master/ child settings **after**
    I set that SQL.

    So, if the 1st above suggestion of clearing out the link master don't work,
    then:

    You could try to ensure the sub forms data source is
    NOT already set (leave it blank).

    Thus, you go:

    Me.Sfrm_3.Sourc eObject = form_3
    me.Sfrm_3.Form. RecordSource = "your sql for form goes here"
    Me.Sfrm_3.LinkM asterFields = Link_2_Parent
    Me.Sfrm_3.LinkC hildFields = Link_2_Child

    I'm quite sure the above (last) suggestion will work with a blank
    datasource. (not exactly a pretty work around, but I think it will solve
    this And tell someone else jumps into this thread with a better suggestion).


    --
    Albert D. Kallal (Access MVP)
    Edmonton, Alberta Canada
    pleaseNOOSpamKa llal@msn.com



    Comment

    • stevenrec

      #3
      Re: Parameter Pop-up when changing subform

      Thanks,

      used the ideas, had to modify it a little to get it to work,
      Usual Friday, could not think of anything else, thanks again for the
      idea.

      Comment

      Working...