If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Calendar control accepts other values
I included a calendar control into a template I am creating and if the user selects the down arrow and picks a date, it works fine.
The problem arises if the user doesn't click on the arrow but types anything, the field accepts the text and the purpose of the calendar is exactly to avoid this. I searched the properties of such command and the only options I found were "Control can't be eliminated" and "Content can't be edited" but none of them prevents entering of text. So is there a way that the control only accepts a value picked through the choice of a date on the calendar itself? |
#2
|
|||
|
|||
Quote:
The last thing I wanted to quickly talk about is the double pipe (||) default operator. This one is terribly useful when you want to make sure that something is set with a default value. The following construct is something that should not show up any longer: |
#3
|
|||
|
|||
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim pStr As String If Val(Application.Version) 14 Then Main.SetDeveloperTabActive pStr = ContentControl.Range.Text If ContentControl.Type = wdContentControlDate Then If Not IsDate(pStr) Then MsgBox "You must enter a date", vbCritical, "Completion error" Cancel = True End If End If End Sub |
Thread Tools | |
Display Modes | |
|
|