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

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Setting & displaying Form values in a subform (A2K 9.0.4402 SR-1)

    Author
    Topic
    #361245

    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?

    Viewing 2 reply threads
    Author
    Replies
    • #545641

      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

    • #545643

      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
      http://engineeringobjects.com/FreeStuff.htm

    • #545707

      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.

      • #545733

        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!

    Viewing 2 reply threads
    Reply To: Setting & displaying Form values in a subform (A2K 9.0.4402 SR-1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: