Calendar

Vallan

Registered User.
Local time
Today, 10:44
Joined
Jan 16, 2008
Messages
46
Hi.

I have made a popupcalendar for choosing of dates.


My question is if there are possabillity to make so that the user cant choose an older date than todays?

Mattias
 
Did you make the pop up calendar yourself or are you using a Calendar or Datate Picker Control?

If you don't want the User to enter any other date other than todays date....then don't use a Pop Up Calendar. Instead, have the user double-click in the field to display todays date (just so they don't have to enter in).

In the OnDblClick event for the Text Box that will contain the Date:

Me.MyFormTextBoxName = Format(Now(), "Short Date")

.
 
Well its a foodordering system so they have to be able to make order in the future but not backwards.


What i mean is that...... i will order food for me tomorrow then i dont want them to be able to make an order choosing a date that already have been.

It would make problems in the control of the monthly consuming.


Mattias
 
Just replace the DatePicker and DateTextbox with the actual name of your controls.

Code:
Private Sub DatePicker_BeforeUpdate(Cancel As Integer)
If Me.DatePicker < Date Then
  MsgBox "You must Enter Today's Date or a Date in the Future!"
  Me.DatePicker.SetFocus
Else
  Me.DateTextbox = Me.DatePicker
End If
End Sub
 
How do i fit this in the code i use today?

Or shall i remove the access calendar?

Code:
Private Sub Datumtest_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
' Unhide the calendar and give it the focus
    ocxCalendar.Visible = True
    ocxCalendar.SetFocus
' Match calendar date to existing date if present or today's date
    If Not IsNull(Datumtest) Then
        ocxCalendar.Value = Datumtest.Value
    Else
        ocxCalendar.Value = Date
    End If

End Sub

Thanks for the help
Mattias
 

Users who are viewing this thread

Back
Top Bottom