Solved

restrict DTPicker in vb6

Posted on 2014-01-22
3
347 Views
Last Modified: 2014-01-22
I have the following code below to find if the day of the month is before the 9th.

If Day(currentServerTime) >= 9 Then
                    SelectMonth = Format(DateAdd("m", -1, currentServerTime), "yyyy-mmmm")
                    'DTPicker1 = ?
                End If
            End If

Open in new window


If it is before the 9th, I would like to limit the calendar in DTPicker to only the current month.  Is it possible to do this so that a user can only choose the current month?
0
Comment
Question by:al4629740
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
ravikantninave earned 500 total points
ID: 39801602
Surely, you can do this.  If you have to restrict date after certain date then use

dateTimePicker.MaxDate= yourdate
0
 

Author Comment

by:al4629740
ID: 39801704
can DTPicker also default to the current date?

or does that have to happen programmatically?
0
 
LVL 4

Expert Comment

by:ravikantninave
ID: 39801727
I Generally use this to show current date when my form loads from my vb6 app

DTPicker1.MaxDate = Format(Date, "dd/mmm/yyyy")
DTPicker1.Value = Format(Date, "dd/mmm/yyyy")
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

856 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