Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Faifax, Virginia, USA
    Posts
    542
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Setting & displaying Form values in a subform (A2K 9.0.4402 SR-1)

    Parent form has field P, subform has field S.

    In the subform, i set the DefaultValue property of S = [Forms]![Parent]![P].

    In a new record, i enter a value in P, but that value doesnt appear in S.

    In what event do I need to fire off what? a Refresh?

  2. #2
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Faifax, Virginia, USA
    Posts
    542
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting & displaying Form values in a subform (A2K 9.0.4402 SR-1)

    I abstracted my question to a small mdb, and what i want to do works (duh!).

    I shall invest somemore study - your speculations as to why this is not working in a larger case are welcome

  3. #3
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Faifax, Virginia, USA
    Posts
    542
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting & displaying Form values in a subform (A2K 9.0.4402 SR-1)

    I have found in some cases, if I move the Access desktop icon to the center of the screen, crank up 'Stress Relief', and use it for a few seconds on the icon, that things are MUCH better afterwards.

    Stress Relief is not mine, but is available free at
    <A target="_blank" HREF=http://engineeringobjects.com/FreeStuff.htm>http://engineeringobjects.com/FreeStuff.htm</A>

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Setting & displaying Form values in a subform (A2K 9.0.4402 SR-1)

    Are those the field names or the control names? Reference the control name (it isn't necessary to use the full reference, Parent!Control is adequate), but remember that the value will only be inserted when a new record is created in the *subform*. I usually put fields like that at the beginning of the tab order in my subforms but set their tabstop property to false, that skips over the field but inserts the value.
    Charlotte

  5. #5
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Faifax, Virginia, USA
    Posts
    542
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting & displaying Form values in a subform (A2K 9.0.4402 SR-1)

    It was the fag-end of the day, and my thinking was shot, so i'll go back and use the wizard to fill in the fields.

    Your perceptive answer applies: i was just using the mouse to click on the subform, and the parent form had not had a new record made in it yet. Thanks for that.

    In my application, i dont want to necessarily skip the field. The Parent form contains the 'family name' whereas the subform contains the child's last name. In most cases, it will default to the family name, but occasionally, it wont.

    On second thought, If I turn off the tabstop, the user has to click in the field in the occasional case when the data have to be entered - I think I like that behavior!

Posting Permissions

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