Cutoff date in Visual Basic

Posted on 2009-12-21
Last Modified: 2012-05-08
I have a form in VB6.  I have a dropdown box that lists all the months.  However, I want a user to be able to ONLY select the current month based on what month it is.  It has be on the 8th of the current month to the 8th of the next month.

So, for example, if they choose the dropdown today they should only be able to select December.  They can select December all the way up until January 8th.  After that day, they can only select January.

Is there a way to do this in VB6?
Question by:al4629740
    1 Comment
    LVL 8

    Accepted Solution

    The way I understand it, you want it to show December for dates between Dec 8 and Jan 7.  Then on Jan 8, it should change to January.

    You could try this...

    if day(now) < 8 then
        selectMonth = format(dateadd("m", -1, now), "mmmm")
        selectMonth = format(now, "mmmm")

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Port V2 16 36
    Window placement 17 56
    Specify ip address in my connection string for sas 2 36
    change vba from autofit to 13.5 width? 4 25
    Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    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…

    755 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

    20 Experts available now in Live!

    Get 1:1 Help Now