Solved

restrict DTPicker in vb6

Posted on 2014-01-22
3
342 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

911 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

21 Experts available now in Live!

Get 1:1 Help Now