Solved

How populate form field with month name

Posted on 2013-12-03
3
429 Views
Last Modified: 2013-12-03
I have a field on a form that is a date field.  If the user, for example, enters 11/2/2013 in this field I want the month name (November) to automatically populate a second field on the form.



How can I do this?
0
Comment
Question by:SteveL13
  • 2
3 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39692945
Try this in the After Update event of the first textbox:

Textbox2 = Format(Textbox1, "mmmm")
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39692954
This has a sanity check to ensure that a valid date has been entered:


Textbox2 = iif(IsDate(TextBox1,  Format(Textbox1, "mmmm"), "")

Open in new window



And an alternative, assuming this is an unbound field (which it should be), you can set the Control Source property of the second TextBox to:

 = iif(IsDate(TextBox1,  Format(Textbox1, "mmmm"), "")
0
 
LVL 15

Expert Comment

by:JimFive
ID: 39692957
If this is for display purposes only then:
Set the control source for the second field to the same as the date field and set the format to mmmm
You will probably want to set the Enable property for the second field to No, also.

If you need the actual word in a new field to save it in a table then you need to set the code in the After Update property of the date field to
Me("MonthFieldName").value = Format(Me("DateFieldName"),"mmmm")
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

895 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

14 Experts available now in Live!

Get 1:1 Help Now