• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

How to default word into text field on a form?

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?
  • 4
1 Solution
omit the equal sign.
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.

Conclusion:  You can keep the equal sign (but why?)  but you must remove the left and right brackets.
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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?

KrisYoungNYAuthor Commented:
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).
Thanks, glad to help.

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now