Is this possible?

phn

Registered User.
Local time
Today, 17:08
Joined
Mar 17, 2006
Messages
21
Hey guys,

this is a bit difficult to explain but i'll explain it as best I can..

What I want to do is be able to count the number of camera kits that are currently in stock my in database.

I have created a booking database which allows the user to book camera kits out.

I have thought how I could do this but I don't know the code for it :x

Here's how I think it could work:

I need to create a query which will look up each kit by its number (ie. Kit1, to Kit5.) but then I also need it to check the Complete column which is a YES/NO field. If both data returns true then the kit is in stock, if the Kit# is true, and Complete is false, then the kit is booked out.

I then want this data to be displayed on my main menu form like:

total kits: #
available kits: #

does anyone know if this can be done, better yet, how it can be done?

Thanks!
 
You can use DCOUNT to return each count to your form maybe something like
me.totalkits = DCOUNT("KitPrimaryKey","KitTable","KitNumber in ('Kit1','Kit2','Kit3'))
me.availablekits = DCOUNT("KitPrimaryKey","KitTable","KitNumber in ('Kit1','Kit2','Kit3') AND Complete = True)

Basically
 
Thanks for the advice!

I managed to get it working.

I created a query to lookup all the Yes/No items that returned true, and another to lookup the values that returned false.

I then used an invisible text box with DCount to count the number of values in the table.

I then created a visible text box to subtract the number in the invisible text box from the total number of camera kits (5)!
 

Users who are viewing this thread

Back
Top Bottom