Calendar - Not able to select in "Future"

Chimp8471

Registered User.
Local time
Today, 07:17
Joined
Mar 18, 2003
Messages
353
Calendar - Stop user Selecting Future date

I am using the dbPopup Calendar that Milo has posted in the samples section,

i was just wondering if there is a way to prevent the user from selecting a date beyond today.......

i am creating a helpdesk and i use the calendar to record the date the log was recorded, but it would be impossible for someone to predict a fault in the future, so i want to be able disable this.

ideally so that if they click on a dat that is beyond today a message would appear.

Cheers

Andy
 
Last edited:
You could replace the cmdOk_Onclick() with this:

Code:
Private Sub cmdOK_Click()
On Error GoTo Err_cmdOK_Click
    
    If Me.ctlCalendar.Value > Date Then
        Me.ctlCalendar = Date
        MsgBox ("Your error?")
    Else
        Forms(strForm).Controls(strControl) = Me.ctlCalendar.Value
        DoCmd.Close acForm, Me.Name
    End If
    
Exit_cmdOK_Click:
    Exit Sub
    
Err_cmdOK_Click:
    MsgBox Err.Description, vbExclamation, "Error #" & Err.Number
    Resume Exit_cmdOK_Click
    
End Sub
________
HERBALAIRE VAPORIZERS
 
Last edited:
Chimp, there's a second Calendar example called Calendar Class in the Samples Database forum. This calendar example contains a property called AllowFutureDates which you can set before opening the calendar.

Maybe that's better for you.
 
Would the Helpdesk staff need to enter a date prior to the date they recorded the log?

If not then have the date automaticallypopulate a text field on the form. then have the text feild to locked so that the users can't change the date.
 
mousemat said:
Would the Helpdesk staff need to enter a date prior to the date they recorded the log?

If not then have the date automaticallypopulate a text field on the form. then have the text feild to locked so that the users can't change the date.

That would work, but what if the staff accidently forgot to add something?
________
On Porn
 
Last edited:
a.sinatra said:
what if the staff accidently forgot to add something?

It becomes a training issue and is escalated accordingly. ;)
 
It becomes a training issue and is escalated accordingly.

And we have all heard of the training Helpdesk staff get !!!!!
 

Users who are viewing this thread

Back
Top Bottom