Clear Bound Control

  • Thread starter Thread starter iami
  • Start date Start date
I

iami

Access 2007 Vista

I have a form with three fields
StartDate format date dd-mmm
Dlbl click has popCalendar()

NumbSession, integer

EndDate format date dd-mmm
Dlbl click has popCalendar() also

EndDate needs to show the same date as StartDate if
NumbSession < 2 but if Numbe Session is >1 then
EndDate needs to be set with popCalendar.

PopCalendar works for both fields, it is not the question. The
question is how to default EndDate to
pickup the same date as entered in StartDate, but allow
it ot be changed with PoipCalendar if NumbSession is >1 ?
 
In the AfterUpdate event of both StartDate and NumbSession, a bit of code
something like:

If NumbSession is <= 1 Then
EndDate = StartDate
End If

DoubleClicking in EndDate will still allow changing to the popCalendar date.
You can change that with code like:

If NumbSession is <= 1 Then
EndDate = StartDate
EndDate.Locked = True
End If

Remeber to change the locked property back, conditionally, if necessary, in
the Current event of the form itself or it will remained locked.
 
Back
Top