unbound text box default value a concatenation of values from other subs

Posted on 2006-05-10
Last Modified: 2008-03-04
I'd like to make the default value of an unbound control a concatenation of the values of two txt boxes on other subforms. I've used =forms!frmMain.... & forms!frmMain... That's obviously not the right syntax. Any ideas?

Question by:eliwil
    LVL 34

    Expert Comment

    This may help you:
    Forms: Refer to Form and Subform properties and controls
    LVL 8

    Expert Comment

    Do brackets help?
    =(forms!frmMain.... & forms!frmMain... )
    LVL 46

    Expert Comment

    Hi eliwil,
    Don't forget the "Form" something like
    Good Luck!

    LVL 65

    Expert Comment

    I prefer the use of Me.<nameofsubform>.form.<nameofcontrol>

    two subforms, called Child1 and Child2,

    MainFormTextBox.Value = Me.Child1.Form.txtBox.Value & Me.Child2.Form.txtBox.Value

    LVL 58

    Accepted Solution

    Hello eliwil

    I think the problem is with "default value of an unbound control", not the actual syntax. This gets evaluated before the subforms even load, so that you cannot do much about it. Also, it doesn't really make sense. The default value for an unbound control is really only evaluated when the form opens, never again.

    It's different for bound controls, because that's the value you get on the "new" record.

    Perhaps you simply want to display the concatenation. In that case, use the Control Source property rather than the Default Value property. The user can still select the information for cut-and-paste, for example. If you need the user to later edit that information, you will have to write into your control through VB event handlers in your subforms...

    Hope this helps!


    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now