MonthCalendar in form

  • Thread starter Thread starter Todd
  • Start date Start date
T

Todd

I downloaded the MonthCalendar Access 2000.zip from
Lebans.com and I'm wondering what the process is to add
the function to my database? I've used one of the ActiveX
controls on my pc (I've got Access 2000) and it works fine
but if someone else uses it the function doesn't work
because of different versions of Access I'd imagine.

Wouldn't this code do the trick to fix it and if so how do
I implement it? Any help would be appreciated.
 
As the Web page explains this is not an ActiveX control that you have to
register. To use the MonthCalendar you simply:
1) Import all of the Code and Class modules into your own MDB.
2) Look at the code behind one of the sample Forms and implement this
code behind your own Forms. It's only a couple of lines of code.

THat's it.
:-)
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
I imported all the code modules into my database. I then
copied the class code from the load and unload events of
one of the sample forms you have into my form. When I
tried to run it I got a compile error "Dim Db As
DAO.Database". What does that mean?

Also, after I import the code don't I need to add a text
box to my form and give it the same name you have in the
sample form? What do I do if I want two calendars in my
form, one for start date and one for end date for record
sorting purposes.

Sorry for the hassale!
 
Access 2000 and higher do not have a default Reference to Microsoft DAO.
Open any code or class module and from the Tools menu select References.
Scroll down to select the Microsoft DAO object library.

As for your second question, obviously yes, you will have to place the
code to call the MonthCalendar behind the Click event of some control on
your Form. If you look at the code behind the sample Forms you
downloaded the call tot he MonthCalnedar class is place dbehind the
Click event of a TextBox control that is Bound to a field of type Date.

As for selecting multiple dates just have two TextBox controls suchas
txtStart and txtEnd. Alternatively, again if you look at the code behind
the sample forms the MonthCalendar does support allowing theuser to pick
a date range from one Calendar window.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
I spoke too soon. It works on my pc but when someone
opens it out on the network it gives a compile error when
they double click the text box to open the calendar. The
compile error says "can't find project or library.

The library I have selected is the Microsoft DAO 3.6
library. Would that have an effect on the other pcs if
they don't have the same access 2000 version I have?
 
THe calendar works with all versions of Access but as with yours,, for
A2K or higher, a reference must be set for the DAO Object library.
You do have your MDB split into a Front End(Forms etc.) and a Back
End(Tables) don't you?

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Not yet. I plan on doing that but first I was just
testing it on the network with another user that will be
using the database. Would not splitting it cause the
compile error?
 
No matter what you should split the MDB for performance, updating and
reduction of corruption issues.

As for the core issue here, if your users are running A2K or higher they
will have to manually set a reference to the MS DAO Object library or
you can create a function to do it for them within your app.


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top