Calendar Control

trsisko

Board Regular
Joined
May 20, 2008
Messages
176
I actually have the following code. I want to use the Calendar Control Ver 11 to Input the Date if Date based Answer is Selected.

I have created Calendar1 on a FormCalendar with a Command buttton cmdEnterDate. I want this to Pop and Pass the Date to UserMenu txtInput textbox.


Code:
Private Sub cmdNext_Click()
    If txtInput.Visible Then
        Select Case m_Validation
            Case "D": 'Date
                If Not IsDate(m_Response) Then
 
                    MsgBox "Please enter a valid date !", vbCritical
                    txtInput.SetFocus
                    Exit Sub
                Else
 
                    m_Response = Format(m_Response, "dd mm yyyy") 'changed in version 7.34. May need to add both date formats
 
                End If
 
            Case "P" 'Percentage
                If Not IsNumeric(m_Response) Then
                    MsgBox "Please enter a valid % !", vbCritical
                    txtInput.SetFocus
                    Exit Sub
                Else
                    m_Response = Format(m_Response, "0.00%")
 
                End If
 
            Case "N" 'Numeric - Currency - Term Lenght - Age etc
                If Not IsNumeric(m_Response) Then
                    MsgBox "Please enter a valid Number !", vbCritical
                    txtInput.SetFocus
                    Exit Sub
                Else
                    m_Response = CDbl(m_Response)
                                    End If
 
                        Case "T": 'Free Flow Text
                m_Response = DoSpellCheck(m_Response)
 
            Case Else:
                m_Response = m_Response
 
 
        End Select
 
    End If
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Ok. Solved this.

UserCalendar Form

Code:
Public CalendarVal As Date
Private Sub Calendar1_Click()
CalendarVal = Me.Calendar1.Value
Unload Me
End Sub

UserQuestions

Code:
  If m_QID = "12" Then
   UserCalendar.Show
txtInput.Value = UserCalendar.Calendar1.Value
    End If
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top