How to display the current month - InfoPath Dev
in

InfoPath Dev

How to display the current month

Last post 01-09-2008 08:34 AM by Clay Fox. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-09-2008 03:37 AM

    • Zeetec
    • Not Ranked
    • Joined on 10-09-2007
    • Posts 9

    How to display the current month

    Hi,

     I have a drop down menu which users choose the current month from. 

    How can I make the current month display in the drop down automatically?

     Thanks.

  • 01-09-2008 06:40 AM In reply to

    Re: How to display the current month

    If you have a database you could use a table or create a simple XML to use as a secondary datasource.

    Two columns

    Number  Name

    01             January

    02             February

    Etc...

    Then in Open Rules parse the date. Since the date is yyyy-mm-dd we need to get just the month from the string and then use it to look up the correct value from the secondary data source list. 

    Set your drop down to Name[number = substring-before(substring-after(today(), "-"), "-")]

  • 01-09-2008 08:04 AM In reply to

    • Zeetec
    • Not Ranked
    • Joined on 10-09-2007
    • Posts 9

    Re: How to display the current month

    Thanks for that Clay,

    But I'm currently not using a DB table so how would I be able to do this using a drop down list.

    Would it be possible for me to create a drop down list and then set it's value to show just the month part of the date by doing something like:-

     substring today(), 6, 2

    The above doesn't work but I think it might just need tweaking a bit.

    Thanks.

  • 01-09-2008 08:34 AM In reply to

    Re: How to display the current month

    I think you could do this.

    Add manual entries in your drop down. Make the value a number and the display the name of the month.

    Then you could use a rule to set the field value to substring(today(),6,2) You need to build it in the formula window as today() does not copy.

    That should do it.

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.