update yes/no with pop up calender

G

Guest

Had a string about this the other day but couldn't resolve the issue:
I have a yes/no box that I want to be update to yes if the date in the date
box is greater than today's day (all on same form). I'm using a pop-up
calender for the date box and for some reason the code to update the yes/no
box won't work.
Here is the code for the AfterUpdate event in the calendar and the code that
places the date in datebox after the calender closes.

Private Sub CallDate_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Set cboOriginator = CallDate
Calendar3.Visible = True
Calendar3.SetFocus
If Not IsNull(cboOriginator) Then
Calendar3.Value = cboOriginator.Value
Else
Calendar3.Value = Date
End If
End Sub

Private Sub CallDate_AfterUpdate()
If Me![CallDate] > Now() Then
Me![Active] = -1
Else
Me![Active] = 0
End If
End Sub

Thanks for any suggestions
 
R

rwr

Ian said:
Had a string about this the other day but couldn't resolve the issue:
I have a yes/no box that I want to be update to yes if the date in the date
box is greater than today's day (all on same form). I'm using a pop-up
calender for the date box and for some reason the code to update the yes/no
box won't work.
Here is the code for the AfterUpdate event in the calendar and the code that
places the date in datebox after the calender closes.

Private Sub CallDate_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Set cboOriginator = CallDate
Calendar3.Visible = True
Calendar3.SetFocus
If Not IsNull(cboOriginator) Then
Calendar3.Value = cboOriginator.Value
Else
Calendar3.Value = Date
End If
End Sub

Private Sub CallDate_AfterUpdate()
If Me![CallDate] > Now() Then
Me![Active] = -1
Else
Me![Active] = 0
End If
End Sub

Thanks for any suggestions

I replied to the other thread, try this.

Private Sub CallDate_AfterUpdate()
dim xDate as Date

xDate = Me![CallDate]
If xDate > Date Then
Me![Active] = -1
Else
Me![Active] = 0
End If
End Sub

Ron
 

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

Similar Threads


Top