Solved

How populate form field with month name

Posted on 2013-12-03
3
438 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
linked sql server tables - should I or shouldn't I and why 4 63
Menus 6 57
MS Access query 16 61
microsoft Access form help 5 17
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Familiarize people with the process of utilizing SQL Server functions 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 Ac…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

738 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