How to default word into text field on a form?

Posted on 2011-04-23
Last Modified: 2012-05-11
Hello -

I have thee identical forms that all share one field (and others) - but I was hoping to make a form-specific field that would default a different word on each of the three different forms (One form would default the word, "Nonconformance Report", One form would default the word, "Material Substitution Request", One form would default the word, "Dwg/BOM Change Request".  

Inside one of the forms, I clicked on the field (that I want to default a word into) for properties and under the Data tab\Default Value, I typed, [   ="Nonconformance Report"  ] as an example - but it does not show up when I switch back to form view.  Is there a simple solution to this?  Can anyone help?
Question by:KrisYoungNY
    LVL 44

    Expert Comment

    omit the equal sign.
    LVL 44

    Expert Comment

    In my test form, in a text box, with properties showing, under the Data tab in the Default Value I typed:

    Nonconformist Report

    with and without double quotes.  In the latter, the system entered them anyway.  When I tried to wrap the expression with brackets, I got an error message.  It does not like brackets in a Default Value.

    LVL 44

    Accepted Solution

    Conclusion:  You can keep the equal sign (but why?)  but you must remove the left and right brackets.
    LVL 26

    Expert Comment

    I don't quite understand what your requirement is.
    <three identical forms that all share one field>
    So, is the control that is going to display these form specific values bound to a control source?

    If so, it will pick up the value from the underlying table when you are on a record.
    When you are on a new record, it will be blank.

    You could set it in the Dirty event

    if nz(me.thecommoncontrol.value,"") = "" then
        me.thecommoncontrol.value = "Nonconformance Report"
    end if

    If it is an unbound control, and therefore just a glorified label, you could put the same code in the load event.
    I am not clear on it's purpose.  Can you explain?


    Author Comment

    Thank you all for your help.  I see my foolishness.  It was working all along.  But it just wouldn't show on records that had already been entered.  It would only show on a new record.  

    I wanted one table to house all the required fields for thee or four different kinds of major forms.  They all dealt with different aspects of Quality (Nonconformances, Customer Complaints, Specific-contract's Material Substitution requests, Permanent Drawing/Bill of Material Change requests, etc.) - but needed to be entered with minimal confusion - and be able to report general trends across all Quality aspects.  One of the reports will, for example, want to view all issues we've ever had with a certain kind of a widget (they could be nonconformances, customer issues, material changes, etc.) - and we'd want the list - but would also want to know what kind of an issue it was simply by looking ag the field that was defaulted on each of those forms (Nonconformance Report, Drawing change, Customer Complaint, etc).  Anyway, I appreciate Nick67's help but that didn't really address what I needed; I'll award the points to GRayL (thank you for seeing that I was clearly doing something that should have worked - and for checking my work thoroughly).
    LVL 44

    Expert Comment

    Thanks, glad to help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    This isn't a frequent question on EE. I must have seen it three or four times (among several thousand questions). However, I use this trick quite often, most frequently as a delayed Current event. A form does not expose it's calculation dependenc…
    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    737 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

    19 Experts available now in Live!

    Get 1:1 Help Now