As it stands, the code sets a global variable to the text box and assigns
the value back to that text box when you choose a date.
Since you are not opening it modally, and you could (at least in theory)
have multiple instances open at once, you will need to perform a more
serious re-write.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Mark" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> Allen,
> Thanks for the response. It's a great little calendar. I'm just not very
> proficient in coding and was hoping for some help in adapting it as a
> permanent subform. When the main form opens, the subform apparently cannot
> find something it needs and I get the message: "The expression you entered
> refers to an object that is closed or doesn't exist".
>
> Do I need to place the code that's normally attached to the calendar
> command
> button (the button that opens the calendar) somewhere on the main form or
> in
> the calendar's open event?
>
> Thank you.
> Mark
>
> "Allen Browne" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Because it's just a simple little Access form, you can adapt it any way
> you
>> want, including using it as a subform.
>>
>> Of course, you will need to rewrite the code to match your adaptations.
>>
>> --
>> Allen Browne - Microsoft MVP. Perth, Western Australia
>> Tips for Access users - http://allenbrowne.com/tips.html
>> Reply to group, rather than allenbrowne at mvps dot org.
>>
>>
>> "Mark" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > This may be asking too much, but does anyone know how to use the
> calendar
>> > (frmCalendar) from Allen Browne's Calendar97.mdb as a subform on a main
>> > form, rather than as a modal popup?
>> >
>> > I would like to use the calendar's default date (today) or change to
>> > another
>> > date as needed,obviously, but also make selections on other controls on
>> > the
>> > main form without closing the calendar. Having a hidden text box to
>> > hold
>> > the
>> > calendar's value would not be a problem.
>> >
>> > I tried using it as a subform, but when I open the main form I get an
>> > error:
>> > "The expression you entered refers to an object that is closed or
> doesn't
>> > exist". If I use a command button on the main form to open the popup
>> > calendar as intended to set the value of a textbox, then the subform
>> > version
>> > of the calendar also will work to set the value of that same textbox. I
>> > just
>> > don't understand the code well enough to make this work using only the
>> > subform.
>> >
>> > I'm trying to replace MSCAL.Calendar.7 which works fine all the way
>> > through
>> > Access 2007, but doesn't work in Access 2010. I would rather not go to
>> > a
>> > popup calendar and would prefer not to have to install Access 97 on
>> > computers already loaded with Access 2010. My design work is still in
>> > Access
>> > 97, so whatever changes I make need to start there.
>> >
>> > Thanks for any assistance.
>> > Mark
>> >
>> >
>
>