We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

How to default word into text field on a form?

KrisYoungNY
KrisYoungNY asked
on
Medium Priority
231 Views
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?
Comment
Watch Question

Commented:
omit the equal sign.

Commented:
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.

Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
CERTIFIED EXPERT
Most Valuable Expert 2014

Commented:
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

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).

Commented:
Thanks, glad to help.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.