Calendar Woes

I

iami

Access 2007, XP pro

Having a Calendar issue, can't figure out. I would certianly
appreciate any help or direction.

Here the case:
StartDate, format dd-mmm, has Popcalendar() , works fine NumbSession
format Text. usally numbers 1 thru 10 EndDate format dd-mmm has a
popCalendar also, but I want EndDate to be the same as StartDate "if"
NumbSession =1, else I want to use popcalendar to select the EndDate.

If have this in Control Source opf EndDate:
=iif([NumbSession]=1,[StartDate],[EndDate])
where EndDate should be blank and could be replaced with popCalendar
date, It don't work.....
I have tried " " and 'nothing', and null. These two clear StartDate
when StartDate not= "1", but prevent popcal from inserting a date on
click.

Any ideas ?

Tom Rector
 
I

iami

The Calendars work fine (Stephen Lebans I beleive), the problem is
the EndDate field,
The 'Control Source' for that field is =iif([NumbSession]=1,
[StartDate],[EndDate])
this causes the popup calendar not fill the cell with the date. My
quetion is how do I pick the data that
is in the StartDate field when the NumbSession field =1 or use the
popup calendar if the NumbSession field >1
?
 
I

iami

If you are using my popCalendar()

http://www.datastrat.com/Download/Calendar2K.zip

just use:

 =popCalendar()

in the double-click event of a text box. Then click on any date you want.
--
Arvin Meyer, MCP, MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmvp.com






Access 2007, XP pro
Having a Calendar issue, can't figure out.  I would certianly
appreciate any help or direction.
Here the case:
StartDate,  format dd-mmm, has Popcalendar() , works fine NumbSession
format Text. usally numbers 1 thru 10 EndDate  format dd-mmm  has a
popCalendar also, but  I want EndDate to be the same as StartDate "if"
NumbSession =1, else I want to use popcalendar to select the EndDate.
If have this in Control Source opf EndDate:
=iif([NumbSession]=1,[StartDate],[EndDate])
where EndDate should be blank and could be replaced with popCalendar
date,   It don't work.....
I have tried " "  and 'nothing', and null.  These two clear StartDate
when StartDate not= "1", but prevent popcal from inserting a date on
click.
Any ideas ?
Tom Rector- Hide quoted text -

- Show quoted text -

I guess I screwed up asking my question correctly. The Calendar is
active and works on click
filed name is EndDate"
Control Source=[StartDate]
on double click=PopCalendar()

Now what I need, is have EndDate have a default value of =
[StartDate], then if that is not the date I need,
I want to double click and insert a PopCalendar date.
Right now when I try to enter a popCalendar date, I get error:
Control can be edited because its bound to the
expression'[StartDate]' .

My question is how can show StartDate as the deflaut value for
EndDate and then be able to change it if
if is not the correct date ?

I have tried...
I have another field NumbSession, that if it equals 1 , then
Enddate should be the same as StartDate ,
if NumbSession equals anything else, I need to pick the date with
popCalendar(). I tried to do
iif([NumbSession]>1,null,[StartDate]) , works if NumbSession is 1,
but does not let me pick date
if value is more than 1, got the error "cannot be edited ....bound to
the expression iif..."
This is what I would prefer as the fix.

Can it be done ?
 
A

Arvin Meyer [MVP]

I posted an answer to this but it must have gotten lost in the ether. Yes
you can do this. First change the ControlSource of EndDate so it is bound to
the EndDate field instead of the StartDate field.

Now use the AfterUpdate event of the StartDate field to write the following
code (and possibly the same code in the AfterUpdate of NumbSession as well),
make sure that you change the names to fit yours exactly, and remember, I
cannot debug this code because I'm typing it directly into the newsreader:

Private Sub txtStartDate_AfterUpdate()
If Me.txtNumbSession = 1 Then
Me.txtEndDate = Me.txtStartDate
Else
Me.txtEndDate = Null
End Sub

Now, end date is not bound to start date, but will use it when the start
date is "pushed" into it.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


If you are using my popCalendar()

http://www.datastrat.com/Download/Calendar2K.zip

just use:

=popCalendar()

in the double-click event of a text box. Then click on any date you want.
--
Arvin Meyer, MCP,
MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmvp.com






Access 2007, XP pro
Having a Calendar issue, can't figure out. I would certianly
appreciate any help or direction.
Here the case:
StartDate, format dd-mmm, has Popcalendar() , works fine NumbSession
format Text. usally numbers 1 thru 10 EndDate format dd-mmm has a
popCalendar also, but I want EndDate to be the same as StartDate "if"
NumbSession =1, else I want to use popcalendar to select the EndDate.
If have this in Control Source opf EndDate:
=iif([NumbSession]=1,[StartDate],[EndDate])
where EndDate should be blank and could be replaced with popCalendar
date, It don't work.....
I have tried " " and 'nothing', and null. These two clear StartDate
when StartDate not= "1", but prevent popcal from inserting a date on
click.
Any ideas ?
Tom Rector- Hide quoted text -

- Show quoted text -

I guess I screwed up asking my question correctly. The Calendar is
active and works on click
filed name is EndDate"
Control Source=[StartDate]
on double click=PopCalendar()

Now what I need, is have EndDate have a default value of =
[StartDate], then if that is not the date I need,
I want to double click and insert a PopCalendar date.
Right now when I try to enter a popCalendar date, I get error:
Control can be edited because its bound to the
expression'[StartDate]' .

My question is how can show StartDate as the deflaut value for
EndDate and then be able to change it if
if is not the correct date ?

I have tried...
I have another field NumbSession, that if it equals 1 , then
Enddate should be the same as StartDate ,
if NumbSession equals anything else, I need to pick the date with
popCalendar(). I tried to do
iif([NumbSession]>1,null,[StartDate]) , works if NumbSession is 1,
but does not let me pick date
if value is more than 1, got the error "cannot be edited ....bound to
the expression iif..."
This is what I would prefer as the fix.

Can it be done ?
 
I

iami

I posted an answer to this but it must have gotten lost in the ether. Yes
you can do this. First change the ControlSource of EndDate so it is boundto
the EndDate field instead of the StartDate field.

Now use the AfterUpdate event of the StartDate field to write the following
code (and possibly the same code in the AfterUpdate of NumbSession as well),
make sure that you change the names to fit yours exactly, and remember, I
cannot debug this code because I'm typing it directly into the newsreader:

Private Sub txtStartDate_AfterUpdate()
    If Me.txtNumbSession = 1 Then
        Me.txtEndDate = Me.txtStartDate
    Else
        Me.txtEndDate = Null
End Sub

Now, end date is not bound to start date, but will use it when the start
date is "pushed" into it.
--
Arvin Meyer, MCP, MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmvp.com


If you are using my popCalendar()

just use:

in the double-click event of a text box. Then click on any date you want.
news:9deb613b-8863-4cb9-bca3-94ea9fbadd05@x38g2000yqj.googlegroups.com....
Access 2007, XP pro
Having a Calendar issue, can't figure out. I would certianly
appreciate any help or direction.
Here the case:
StartDate, format dd-mmm, has Popcalendar() , works fine NumbSession
format Text. usally numbers 1 thru 10 EndDate format dd-mmm has a
popCalendar also, but I want EndDate to be the same as StartDate "if"
NumbSession =1, else I want to use popcalendar to select the EndDate.
If have this in Control Source opf EndDate:
=iif([NumbSession]=1,[StartDate],[EndDate])
where EndDate should be blank and could be replaced with popCalendar
date, It don't work.....
I have tried " " and 'nothing', and null. These two clear StartDate
when StartDate not= "1", but prevent popcal from inserting a date on
click.
Any ideas ?
Tom Rector- Hide quoted text -
- Show quoted text -

I guess I screwed up asking my question correctly.  The Calendar is
active  and works on click
   filed name is EndDate"
   Control Source=[StartDate]
    on double click=PopCalendar()

 Now what I need,  is have EndDate have a default value of =
[StartDate], then if that is not the date I need,
I want to double click and insert a PopCalendar date.
 Right now when I try to enter a popCalendar date, I get error:
Control can be edited because its bound to the
expression'[StartDate]' .

   My question is how can show StartDate  as the deflaut value for
EndDate and then be able to change it if
if is not the correct date ?

I have tried...
   I have another field NumbSession, that if it equals 1 , then
Enddate should be the same as StartDate ,
if NumbSession equals anything else, I need to pick the date with
popCalendar().  I tried to do
iif([NumbSession]>1,null,[StartDate])  , works if NumbSession is 1,
but does not let me pick date
if value is more than 1, got the error  "cannot be edited ....bound to
the expression iif..."
 This is what I would prefer as the fix.

Can it be done ?- Hide quoted text -

- Show quoted text -

Thanks, worked as required, I appreciate the help.
 

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