check boxes and calender help!

jax

Registered User.
Local time
Today, 17:52
Joined
Mar 4, 2002
Messages
61
I actually have two problems!!

1. I want a check box to automatically be ticked if another field containing a date is in the future. I get this working but it only shows the ticks if I close the form and reopen it. I am a little confused as to which event to place the code in and where to put the refresh (if thats whats needed)?

2. I have calender opening for entering dates into a form. This works perfectly and closes the calender when a date has been chosen, my problem is that if no date is chosen the default entry in the field is todays date, and cannot be deleted. How do i close the calender and leave field blank if user decides not to enter date?
 
Not sure about the Calender as I've never used one before but the check box sounds simple enough. After the code that recognises the future date (I'm assuming this is either in the On Change or After Update event) place this line.

Me.Repaint

This should update your check box...

Hope this makes sense
 
Jax, would it not be better to warn the user of the incorrect date? I use a smll piece of code behind a 'Print' command button on a claendar form, like so, where StartDate and EndDate are the nnames of tthe text bioxes for showing the dates selected.

'Check to see that ending date is later than beginning date.
If IsDate(StartDate) And IsDate(EndDate) Then
If EndDate < StartDate Then
MsgBox "The end date must be later than the start date."
SetDate.Caption = "Set End Date"
SelectDate.SetFocus
Exit Sub
End If
Else
MsgBox "Please use a valid date for the start date and the end date values."
Exit Sub
End I

Hope this helps.

David
 
DJN thanks for that code i will put it to good use. The problem i have with the calender is one of the dates is not always required - I have three date fields, 1.start date, 2.end date, 3.resignation date - the third field is not always filled, but if clicked the user cant close the calendar without it entering todays date, this gives false results. Thanks for any help
 
I use the following code for my calender it means you van close it without selecting a date

Private Sub TglDateReceived_Click()

If Me!ActiveXCtlDateReceived.Visible = True Then
Me!ActiveXCtlDateReceived.Visible = False
Else
Me!ActiveXCtlDateReceived.Visible = True
End If

End Sub
 
thanks Geoff i will give it a try and let you know how i get on
 

Users who are viewing this thread

Back
Top Bottom