Solved

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

Posted on 2004-10-12
8
195 Views
Last Modified: 2010-05-18
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.


0
Comment
Question by:salimdeath
  • 4
  • 4
8 Comments
 
LVL 13

Expert Comment

by:Corey2
ID: 12291275
Are you only handling one selected date at a time or a week etc.?

Corey
0
 

Author Comment

by:salimdeath
ID: 12291398
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

0
 
LVL 13

Expert Comment

by:Corey2
ID: 12291717
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
0
 

Author Comment

by:salimdeath
ID: 12292002
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


0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 13

Accepted Solution

by:
Corey2 earned 500 total points
ID: 12300456
Unfortunately it isn't quite a walk in the park.
I could maybe give you a bit of instruction though.

Class Reservation

Private Res_ID As Integer
Private Room_Name As String
Private DateTime_Called As Date
Private DateTime_OfMeeting As Date
Private Reserved_By As String
Private Payment_Type As String
Private Reservation_TakenBy As String
Private Confirmed As Boolean

Private Res_ID As Integer
Private Room_Name As String
Private DateTime_Called As Date
Private DateTime_OfMeeting As Date
Private Reserved_By As String
Private Payment_Type As String
Private Reservation_TakenBy As String
Private Confirmed As Boolean



Public Sub SetRes_ID(ByRef ResID As Integer)

If ResID = 0 Then
  Res_ID = CreateNewResID 'some function that would generate
                                          'a unique ID
Else
  Res_ID = ResID
End If

End Sub

Public Property Get GetRes_ID() As Integer
   GetRes_ID = Res_ID
End Property

Public Sub SetDateTime_OfMeeting(ByRef DateTime As String)
   
    Dim Holder As Variant
    Dim I As Variant
    Holder = Split(DateTime, "@", -1, vbTextCompare)
   
    DateTime_OfMeeting = (Trim((Holder(0)))) & " " & (Trim(Holder(1)))
     

End Sub

Public Property Get Get2hrBefore() As Date
    Dim TwoHours As Date
    TwoHours = "02:00"
    Get2hrBefore = DateTime_OfMeeting - TwoHours
End Property

Public Property Get Get2hrAfter() As Date
    Dim TwoHours As Date
    TwoHours = "02:00"
    Get2hrAfter = DateTime_OfMeeting + TwoHours
End Property

End Class

'here is a sub you can run to demonstrate how the class will work

Sub test()

Dim TestClass As Reservation
Set TestClass = New Reservation

TestClass.SetRes_ID 1234
MsgBox TestClass.GetRes_ID

TestClass.SetDateTime_OfMeeting ("10/13/04 @ 12:20")

MsgBox TestClass.Get2hrBefore

MsgBox TestClass.Get2hrAfter

End Sub

I hope this helps
Corey


0
 
LVL 13

Expert Comment

by:Corey2
ID: 12300462
Oh yeah change any variants to objects I was screwing around with it in VBA

Corey
0
 

Author Comment

by:salimdeath
ID: 12301497
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.
0
 

Author Comment

by:salimdeath
ID: 12405171
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


0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now