Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

restrict DTPicker in vb6

Posted on 2014-01-22
3
Medium Priority
?
368 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
ravikantninave earned 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

715 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