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 / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

Conflicting Record Problems

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
NoviceIan - 30 Jan 2006 13:17 GMT
Hi,

We have a staff database which we use to try and keep track of staff leave.  
Recently however I've noticed that staff have been booked in for two
different reasons at the same time.  For example annual leave from the
10th-17th and sick leave from the 12th-14.

We have an index which prevents staff having duplicates for the same leave
day however we've just realised there is no security to prevent the above
problem happening.  

How would I prevent these 'problems' and how will I detect the ones already
in the system?

Ian
Nick Coe (UK) - 30 Jan 2006 13:37 GMT
Depending upon how you've designed your tables you could use
a Select query to show the records where Holiday and Sick
are both Not Null.  Or some variation thereof.

Exactly how you do it depends, as I said , on your table
design i.e. what fields you use, how you distinguish between
Holiday or Sick and so on.

I suspect you probably have a start date and an end date for
the leave period and then a field to show what type of leave
it is and that's how people are managing to enter
overlapping periods.  If this is the case then start
thinking about criteria and table aliases.

Open a query design grid, drop in the table you want TWICE.
The second instance of the table is known as an alias.

Now, assuming the table design above, drag the start date
and end date from BOTH of the tables down into the grid.
Make sure the tables are not joined.
In the criteria for the start date of tbl2 put
=>tbl1.startdate and run it to see if it works.  Then add a
criteria for tbl2.enddate of <=tbl1.enddate.

I'm making this up as I go along <g> so you'll likely need
to mess around with it...

HTH
Signature

Nick Coe (UK)
http://www.alphacos.co.uk/ AccHelp + pAnimal
http://www.pjandcoe.co.uk/ Online Store
http://www.mrcomputersltd.com/ Repairs Upgrades

> Hi,
>
[quoted text clipped - 15 lines]
>
> Ian
NoviceIan - 30 Jan 2006 13:51 GMT
I'm not getting anywhere I keep getting Invalid Syntax message.  
How would I prevent the problem in future?

> Depending upon how you've designed your tables you could use
> a Select query to show the records where Holiday and Sick
[quoted text clipped - 43 lines]
> >
> > Ian
Nick Coe (UK) - 31 Jan 2006 07:00 GMT
Need more specific info on your table design to be able to
offer any more suggestions.

Signature

Nick Coe (UK)
http://www.alphacos.co.uk/ AccHelp + pAnimal
http://www.pjandcoe.co.uk/ Online Store
http://www.mrcomputersltd.com/ Repairs Upgrades

> I'm not getting anywhere I keep getting Invalid Syntax
> message.
[quoted text clipped - 68 lines]
>>>
>>> Ian
NoviceIan - 31 Jan 2006 10:32 GMT
Hi,

The table in question is called absence:

Absence #
Staff #
Reason (Text Field with value list combo box) A/L, Sick Leave, Special,
Study etc
Leave Date
Return Date
Hours Missed

As I mentioned we have an index to prevent staff leaving twice on the same
day however it is possible for them to return twice on a particular day.  
This is the only prevention we have.

Ian

> Need more specific info on your table design to be able to
> offer any more suggestions.
[quoted text clipped - 71 lines]
> >>>
> >>> Ian
Nick Coe (UK) - 31 Jan 2006 15:03 GMT
So your unique index is on Leave Date?

Signature

Nick Coe (UK)
http://www.alphacos.co.uk/ AccHelp + pAnimal
http://www.pjandcoe.co.uk/ Online Store
http://www.mrcomputersltd.com/ Repairs Upgrades

> Hi,
>
[quoted text clipped - 111 lines]
>>>>>
>>>>> Ian
NoviceIan - 31 Jan 2006 15:29 GMT
Leave date and staff number, joint index

> So your unique index is on Leave Date?
>
[quoted text clipped - 113 lines]
> >>>>>
> >>>>> Ian
 
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



©2008 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.