If then else....??? PLEASE HELP

G

Guest

Hi all

I have a db that is used to log work received by various clients and the
progress of each "job". Each job has a deadline time, deadline date and also
a priority. Based on the priority I want to automatically populate the
deadline time and deadline date fileds on the job form.

One client requires a turnaround of 3 hours - regardless of priority.
6 clients have a 10pm deadline
and the rest are as follows

Urgent priority is time received plus 2 hours

Normal priority is a bit more complicated
- if the job is received between 8am and 11.30am then the deadline is 4pm
- if the job is received between 11.30am and 4.30pm then the deadline is
9.30 am the next day
- if the job is received between 4.30pm and 8am then the deadline is 12pm
(the next day for jobs received between 4.30pm and 12am, and sameday for jobs
received between 12am and 8am)

Another factor that is making this more complicated is that the deadline
time is based on UK Time and we are in SA. So at the moment we are 1 hour
ahead in SA but in winter we are 2 hours ahead. and the clock changes on
different dates each year!!!!

Now is it possible to use the if then else in VB to do the above and if yes
then HOW????

Any help or guidance would be appreciated.
 
R

Ron2006

One possibility:
1) Have a priority scheme code field for each client.

2) Have a table for UKTime differential
fields:
effectiveDate
Time difference

In the after update event on the priority have code either do dlookup
or address the field if it is accessable from the form you are on.

Using the result of the lookup then break down the logic for assigning
deadline

Use dlookup to get the time difference using a query that is a query of
a sorted query. Get the Top 1 record that is less than or equal to
today's date from another query that is simply sorted descending by
date.

After that it is a question of compares etc.. Deside what time you are
going to show (UK or local) and make sure that it is clearly labelled
as to which time it is. (Maybe both should be shown if it might be
confusing otherwise.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top