Link to home
Start Free TrialLog in
Avatar of salimdeath
salimdeath

asked on

How to perform an Automatic Time-Picker at Runtime with connection to Database.

Hello,

Good day to everybody,

My problem is that i need to make reservations for Conferences / Meetings that are to be held in our Board room.  The criteria i have been given are ;

1.  No meetings/conferences are to be within the same time in the same board room.

2.  No meetings/conferences should be less than to 2 hours within the same board room.

3.  Meetings/Conferences are to be done withtin 9:00 a.m.  to 17:00, if beyond this time lapse, additional rate of 25% is automatically charged for every hour exceeding 17:00

4.  Board Room 1 , named Calypso hold meetings with 25 people and Board Room 2, named Atlantis hold meetings with 100 people.

My Aim ---> In the form i would prefer to click on a ComboBox or {any better suggested idea from you} that will automatically read from the Database ( MSAcccess 2000 )  and display ONLY slots of available time that i can reserve.  { Example, It's something like MSOutlook Calendar, that gives the blue line for time slot already taken .... }.

Also i would like to have another ComboBox { or any other idea you suggest } for me to view all existing reservations made so far with a range set ( i.e. if i want to see reservations for next month only, i just select it from the ranage ).

The program need to allow me to print at the same time.

Finally, i have been able to design and program the rest of the stuff, it's this part only that is giving me lots of headache.

Any idea will be most welcomed.

Thank you all.
Sally.


Avatar of Corey Scheich
Corey Scheich
Flag of United States of America image

Are you only handling one selected date at a time or a week etc.?

Corey
Avatar of salimdeath
salimdeath

ASKER

Thanks for replying Corey.

There are situations where i have to make reservations for conferences that will be held in 2 months time and at times it happened that i am asked if any room is available the next day.

Sorry for missing this important information.

Sally

I would create a class that would hold the information

date
start
end
BlockedBefore
BlockedAfter
Duration
Room
Guests

the class would handle keeping the duration and endtime in sinc and the guests and the room and so on

I would then create a datetimepicker object on the form.
read up on this here
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWindowsFormsDateTimePickerClassTopic.asp

you may need one for each room I haven't used it myself.

then when you quary your database create a collection of your new timeblock class for each block that is taken.  And if the datetime picker allows you to color in the apropriate fields.

Corey
Though i got the logic of what you are saying above, it sounds pretty difficult to put all these in terms of code.  

I have had a little exposure to vb.net ( only 3 months to now) and been to a course of 1 week only !  Have prior experience on Unix Programming { Bourne Shell  / C / Korn }, but it's like Sky and Earth difference.

Can you please show me what detail code do i need to use ?  The form name i am using is Reserve.vb and my Database name is RoomAlloc.mdb, and the table name for this particular requirement am planning to name it Reservation with attributes as follows;

1.  Reservation_ID { Primary Key }

2.  Room_Name ---> E.g. Calypso

3.  DateTime_Called --> E.g. 10/13/2004 @ 14:30

4.  DateTime_OfMeeting  --> E.g. Meeting to be held on 11/15/2004 @ 11:00

5.  Reserved_By ---> E.g. Ms. Jane Doe

6.  Payment_Type ---> E.g. P.Order / Cheque / CreditCard

7.  Reservaion_TakenBy ---> E.g. Sally or Nathalia, etc

I have other forms and tables.  This table need not have any  Relationships with other Tables in the database.

Thank you
Regards.
Sally


ASKER CERTIFIED SOLUTION
Avatar of Corey Scheich
Corey Scheich
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oh yeah change any variants to objects I was screwing around with it in VBA

Corey
Hi Corey,

Thanks for replying.  You are right in what you said, it's not that easy to be done overnight.  I have been with this Module for the past 10 days, and my boss is chasing me.  They expect everything to be done within hours !!! I lack experience in this new programming language, got to admit it.

I am going to work on the codes you gave me right now.  It's 11:20 p.m. here and will be trying to work on it till 2:00 a.m.  If there's anything that goes wrong i will let you know tomorrow in the office.

Many many many thanks for all you did.  I will revert back to you soon.

My kind regards.
Sally.
Greetings Corey,

Sorry for the late reply.

I was on sick leave for a few days, things are geting back to normal.

I worked on part of the codes, though i could not not make it work as planned above, but this gave me new insight and new directions.

Part of it is working fine with some modfications, and for the rest i am still working on it.

You strongly deserve the 500 points and i wouldn't like to delay furthermore this post.

Thank you again Corey.

If i need your help again, how can i contact you ?

My kind regards.
Sally