Results 1 to 4 of 4
  1. #1
    J4X is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Dec 2015
    Posts
    2

    Input Quarter-of-year on a Form

    Hello folks.

    Basically I need to allow user input data in a Qq/yy or Qq/yyyy format (i.e. "Q4/2015" where "Q4" means last quarter or year 2015 - not Month 4).
    I know I can take a DateTime value in VBA and format it with Format() but this is not what I need.
    I need to provide user a form with an input control where he/she can type data in the above format and have this value stored in a database such a way that I can later perform reports and comparisons (like select all quarters from Q2/2015 to Q1/2016).
    So I have two problems.

    1. Input control.
    2. Data type on my database.

    If I simply take a text field in my table and set the input mask to Q0/0099 I will have problems with my queries since I will not be able to compare records with < and >.
    If I take a numeric or date field, I donīt know how to properly set a working input mask to set the input the way I need.
    Any hints, please?

    Thanks in advance!

    -------------------------------------------
    Solely for my ignorance I have posted this question before trying a specialised forum:
    http://stackoverflow.com/questions/3...r-of-year-data



  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Well, stating the obvious, you can't store the data in that format and have it sort correctly or be query-able. The reverse would work (2015/Q4) for both I think. You could store the values separately and put them together differently for the user vs querying. You could use an unbound textbox to let the user enter in that format and then store it differently. Probably lots of options, but all of them kludges due to the cross-purposes involved.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    J4X is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Dec 2015
    Posts
    2
    After some time thinking I am to agree with you that changing the format to "yyyy/Qq" would ease things a little bit.
    I just fear I will not easily be allowed to do so (Company standard is "Qq/yyyy").

    I can "reparse" this data when printing, of course. Just that my programmer feelings will get hurt.

    Anyway, by having "yyyy/Qq", I can rely only on a single text field bound to a textbox using an input mask and go ahead.

    Thanks!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem, and welcome to the site!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 06-21-2013, 12:28 PM
  2. Replies: 4
    Last Post: 01-09-2013, 11:16 AM
  3. Display previous quarter data when quarter is selected
    By rlsublime in forum Programming
    Replies: 1
    Last Post: 07-03-2012, 03:12 PM
  4. Show Year with Quarter
    By Mordred in forum Access
    Replies: 9
    Last Post: 06-30-2011, 07:50 AM
  5. Replies: 23
    Last Post: 06-30-2010, 02:05 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums