Solved

restrict DTPicker in vb6

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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
Course of the Month3 days, 15 hours left to enroll

630 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