Help with VB code for Calendar

G

Guest

I have inputted the code for a calendar however it doesn't work when I use
this validation '=DateAdd("d",7,Date()) And <=DateAdd("m",2,Date())'

The code I used was

Option Compare Database

Private Sub Calendar2_Click()
Event_Date.Value = Calendar2.Value***
Event_Date.SetFocus
Calendar2.Visible = False
End Sub


Private Sub Event_Date_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Calendar2.Visible = True
Calendar2.SetFocus
If Not IsNull(Event_Date) Then
Calendar2.Value = Event_Date.Value
Else
Calendar2.Value = Date
End If
End Sub


If anyone could help me out with corecting this code so that the calendar
will work with the validation I would be very grateful

The line that the debugger higlights is the starred line above***
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top