Off Topic Cafe If it doesn't belong in any of the other forums. Post all Off Topic stuff here.

Any Ms Access Experts Here?

Thread Tools
 
Old 09-30-2005 | 12:19 PM
  #1  
Joshuwa's Avatar
Thread Starter
Senior Member
 
Joined: Apr 2004
Posts: 818
Likes: 0
From: Michigan
Default

I am trying to create an equipment sign-out database in Microsoft Access, but I'm having trouble making it so that if an item is signed out, that same item cannot be signed out by another individual between the original person's sign-out and sign-in dates.

I have my tables set up like this:

Table: Staff (id, FirstName, LastName)

Table: Laptop (id, Color, Name)

Table: Projector (id, Name)

Table: Sign_out (id, Staff, Laptop, Projector, Sign-out, Sign-in)

In the Sign-out table, the Staff, Laptop, and Projector fields are look-ups from the respective other tables.

I though making Staff, Laptop, Projector, and Sign-out dates all primary keys would acheive this, but it's not working that way.

Any help is GREATLY appreciated!
Old 09-30-2005 | 12:22 PM
  #2  
blacktibby's Avatar
Senior Member
 
Joined: May 2004
Posts: 761
Likes: 0
From: Moncton, New Brunswick
Default

add me to your messenger wheres_my_doggs@hotmail.com I can help you out .
Old 09-30-2005 | 12:38 PM
  #3  
Joshuwa's Avatar
Thread Starter
Senior Member
 
Joined: Apr 2004
Posts: 818
Likes: 0
From: Michigan
Default

sad.gif I don't have MSN, unfortunately.
Old 09-30-2005 | 12:45 PM
  #4  
blacktibby's Avatar
Senior Member
 
Joined: May 2004
Posts: 761
Likes: 0
From: Moncton, New Brunswick
Default

What is the Sql statement your using and what fields are you trying to pull?
Old 09-30-2005 | 12:53 PM
  #5  
Joshuwa's Avatar
Thread Starter
Senior Member
 
Joined: Apr 2004
Posts: 818
Likes: 0
From: Michigan
Default

I haven't isnerted any SQL manually up to this point.

I've just created the table in design view, and trying to set it up so that it doesn't allow two people to sign the same thing out at once, so that later I can create a form based on it.
Old 09-30-2005 | 01:43 PM
  #6  
Cecil's Avatar
Senior Member
 
Joined: Sep 2001
Posts: 154
Likes: 0
Default

So the Staff, Laptop and Projector are actually ID's of the other tables? If thats so just use this statement. It should list all the projector names available to be signed out. That is if when they sign out you set the sign-in field to null. Sorry I use Firebird and not used to access so not sure if the look-up fields are stored as ID's or not, plus you might need some [] around fields for it to work in access. Hope that helps. fing02.gif

select Name from projector
where id not in (select projector from sign_out where (sign-out is not null and current_date >= sign-out and sign-in is null))
Old 09-30-2005 | 07:53 PM
  #7  
Raven997's Avatar
Senior Member
 
Joined: Jul 2004
Posts: 428
Likes: 0
From: Western Kentucky
Vehicle: 99 Tibron
Default

maybe if the sum of a field can't equal zero, if you set it up kinda like that, hell i don't knwo what i am talking about. i took advanced data baseing in college but it was a while ago. and i'm running on 16+ hours of awake time. take that and werk it in yer crank
Old 09-30-2005 | 10:50 PM
  #8  
Joshuwa's Avatar
Thread Starter
Senior Member
 
Joined: Apr 2004
Posts: 818
Likes: 0
From: Michigan
Default

Thank's for the help everyone, I eventually got it figured out fing02.gif




All times are GMT -6. The time now is 02:24 PM.