Help with possible IF....Else statements

Connor

Registered User.
Local time
Today, 13:36
Joined
Oct 21, 2005
Messages
18
I have fooling around with an aircraft database i have created.
i have 4 fields

First Bag Away - first bag time off aircraft and sent to arrivals for pick passenger pick up
Last Bag Away - last bag time sent to arrivals
Inbound First Bag - first bag time that arrivals receives the bags off the aircraft
Inbound Last Bag - last bag time that arrivals receives the bags

Each airline has thier own criteria for baggage times. heres my problem, i have the solution and code in my head, but i cannot for the life of me get it in code, or at least get it right in VB
For british airways, the first bag MUST be received in Arrivals within 10 minutes of that plane being parked.
Lets say that British Airways flight 098 is parked at its servicing gate at 06:45am.
The first bag MUST be received by 06:55 am. if is not, than a field named lblTimesMet would read "First Bag Not received on time"
and the same thign for the last bag times, if the plane parked at, like i said 06:45am, than the LAST bag time would have to be(in British Airways case its within 50 minutes) 07:35am. if it is not met than a label would say "Last bag not recieved on time"

Ive tried doing this within queries, but could get it to work, and SL is a little beyond me, but im reading some tutorials.

If anyone has any help they can offer, or perhaps a link to a site with a similar code, could you please post the link? I have a basic understand of VB aswell, but within access, little different for me.

Thanks in advance.

Connor
 
Last edited:
Connor. Do you have a database setup already that you are working with or is this a solution that you are creating a brand new Application for?
 
i have a database setup already

I forgot to mention that the airline is setup within a combo box. SO when teh user clicks on the combo box and chooses british Airways, or Thomas cook, those corresponding baggage times would be lodaded.
 
Last edited:
I would point you towards the date/time functions. Such as

DateAdd which you can add any given amount of time to a date/time
DateAdd("n", 15, Now) '<--This adds 15 minutes to right now

DateDiff

Search on those and you should find your solution....
 
I would suggest that you normalise the db before you proceed any further, what you've got at the minute looks like a spreadsheet structure
 
Well, i am basisng this database off a spreadhseet, and what i have right now in my database works fine i guess, 1 table, 2forms (one of them just repeats itself, but in a different look and style for payroll purposes, and this IS just a sample database, to show my employer advantages over using excel) and a few reports based off the form(one report queries only those flights added during the current date;Date(), and one to do allll reports, which is pretty redundent, it will be deleted) Now i just need VBA functions to calculate weather or not OTP (On Time Performance) was met during each flight. Thats calculated by comparing the time of arrival to the first bag time, and if for each airline the guide lines are met (eg, 10, 20 and 25 minutes for first bag, and 50, 60 minutes for last bag times, calculated by Last Bag Time from Time of Arrival) than the OTP rules have met for each flight, which for the airline industry is good! You wouldnt be willing to look at the database and tell me where i could possibly improve on it, and start the normalization process.

Your help is always appreciated.

Connor
 

Users who are viewing this thread

Back
Top Bottom