PC Review


Reply
Thread Tools Rate Thread

Calendar ActiveX control 9.0

 
 
=?Utf-8?B?WWFuaWNr?=
Guest
Posts: n/a
 
      16th Nov 2004
Here is my problem :

There are 2 text box (date type) on my form that trigger a calendar control.
(with click event) After date selection, the date will be return to the
textbox that add called it.

Is there a way to let know to the calendar witch textbox is calling it ? I
don't want a create a calendar form for every control that will trigger a
calendar.

Yanick
 
Reply With Quote
 
 
 
 
Nikos Yannacopoulos
Guest
Posts: n/a
 
      17th Nov 2004
Yanick,

I understand the calendar control is on a separate form, opened by the click
event of the text boxes, right? I'll assume the following names in my
example, and you'll have to change to the eal ones:

Form with calendar: frmCalendar
Calendar control: ActiveXctl1

Right now, (part of) the code behind the click event of the text boxes must
look something like:

stDocName = "frmCalendar"
DoCmd.OpenForm stDocName, , , stLinkCriteria

change to:
ctrl = Me.Name & "*" & Me.ActiveControl.Name
stDocName = "frmCalendar"
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , ctrl

This way, you are passing the form and control names separated by a * as an
opening argument to frmCalendar.

The code behind the click event of the calendar should be something like:

sep = InStr(1, OpenArgs, "*")
frm = Left(OpenArgs, sep - 1)
ctl = Right(OpenArgs, Len(OpenArgs) - sep)
Forms(frm).Controls(ctl) = Me.ActiveXctl1

This will work with different forms as well!

HTH,
Nikos

"Yanick" <(E-Mail Removed)> wrote in message
news:953C743B-A9A8-4935-845C-(E-Mail Removed)...
> Here is my problem :
>
> There are 2 text box (date type) on my form that trigger a calendar

control.
> (with click event) After date selection, the date will be return to the
> textbox that add called it.
>
> Is there a way to let know to the calendar witch textbox is calling it ? I
> don't want a create a calendar form for every control that will trigger a
> calendar.
>
> Yanick



 
Reply With Quote
 
=?Utf-8?B?WWFuaWNr?=
Guest
Posts: n/a
 
      17th Nov 2004
Incredible! I didn't know you can pass criteria to a form this way. I was
searching around something like "me.parent" but access doesn't seems to work
la that.

It is working well, thank you very much. Like we can say in Québec,Canada :
Complètement malade! Merci!

Yanick

"Nikos Yannacopoulos" wrote:

> Yanick,
>
> I understand the calendar control is on a separate form, opened by the click
> event of the text boxes, right? I'll assume the following names in my
> example, and you'll have to change to the eal ones:
>
> Form with calendar: frmCalendar
> Calendar control: ActiveXctl1
>
> Right now, (part of) the code behind the click event of the text boxes must
> look something like:
>
> stDocName = "frmCalendar"
> DoCmd.OpenForm stDocName, , , stLinkCriteria
>
> change to:
> ctrl = Me.Name & "*" & Me.ActiveControl.Name
> stDocName = "frmCalendar"
> DoCmd.OpenForm stDocName, , , stLinkCriteria, , , ctrl
>
> This way, you are passing the form and control names separated by a * as an
> opening argument to frmCalendar.
>
> The code behind the click event of the calendar should be something like:
>
> sep = InStr(1, OpenArgs, "*")
> frm = Left(OpenArgs, sep - 1)
> ctl = Right(OpenArgs, Len(OpenArgs) - sep)
> Forms(frm).Controls(ctl) = Me.ActiveXctl1
>
> This will work with different forms as well!
>
> HTH,
> Nikos
>
> "Yanick" <(E-Mail Removed)> wrote in message
> news:953C743B-A9A8-4935-845C-(E-Mail Removed)...
> > Here is my problem :
> >
> > There are 2 text box (date type) on my form that trigger a calendar

> control.
> > (with click event) After date selection, the date will be return to the
> > textbox that add called it.
> >
> > Is there a way to let know to the calendar witch textbox is calling it ? I
> > don't want a create a calendar form for every control that will trigger a
> > calendar.
> >
> > Yanick

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveX Control: Calendar Confused Slug Microsoft Access Form Coding 0 16th Nov 2009 04:11 PM
ActiveX Control:Calendar BillD Microsoft Access 2 21st Oct 2008 12:27 AM
Re: Need ActiveX Calendar Control Joel Microsoft Access Forms 0 24th Mar 2004 04:46 AM
! ActiveX Calendar Control ! Wembly Microsoft Access VBA Modules 1 10th Nov 2003 05:58 AM
ActiveX Calendar Control would_love_some_help Microsoft Access Forms 1 3rd Jul 2003 12:12 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:53 PM.