Clear Bound Control

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 ?
 
N

news.microsoft.com

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.
 

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