Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / ActiveX Controls / September 2004

Tip: Looking for answers? Try searching our database.

Calendar Date Display Problems!!!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Richard C - 29 Sep 2004 10:12 GMT
I have an events calendar, which works relatively well. It
is made up of a Table, which stores all the events
details. It stores the Start Date, End Date (Date form
DD/MM/YYYY) and other details which are txt boxes. Then
there is a Query that gets its information from the same
events table, which is linked to a form, which has an
activeX calendar. Then when the user clicks on a specific
day on that calendar, the query runs and if any matches
are found it will display that event to the user!!!

The Main problem is, it will display the start and end of
the events. However if you have a multi day event and you
click a middle day, it will not recognize this. This means
events could be missed off and things could be double
booked!!!

I have been looking at some date manipulators, one of them
being DateDiff and
I would like to incorporate this into my query, but I
don't know how to do it!!!
As I mentioned before, the calendar runs from a query that
is linked to Activex Calendar. In the query under
DateStart & DateEnd, the Criteria is set to;

[Forms]![Events_Table]![txt2Date]

This links the query to my Form called Events_Table, the
start and end dates are compared to txt2Date, which is the
link with the activex Calendar!!! So obviously when the
calendar is clicked on a specific day, that day is checked
through the query and if a match is found, then the event
with the matching start or end dates are displayed simply
enough.

I need to modify theses expressions to take into account
the days between the start and end dates. This is where I
thought dateDiff my come in useful, it could check the
difference between the dates and then do a count when ever
the calendar is clicked!!!

Does anyone know how to do this? I have had a play with
altering the expression, but haven't got anything close
yet!!

Any Help would be great!!!

Rich
Alex Dybenko - 29 Sep 2004 10:29 GMT
if i understand you - you can use IsOverlapping function in your query, it
returns true when 2 dates ranges overlaps

Public Function IsOverlapping(ByVal Per1Beg As Date, _
ByVal Per1End As Date, _
ByVal Per2Beg As Date, _
ByVal Per2End As Date) As Boolean
If Per1Beg <= Per2Beg And Per1End <= Per2Beg Then Exit Function
If Per1Beg >= Per2End Then Exit Function
IsOverlapping = True
End Function

HTH
Signature

Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com

>I have an events calendar, which works relatively well. It
> is made up of a Table, which stores all the events
[quoted text clipped - 43 lines]
>
> Rich
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.