hi, i'm currently doin a booking system...i have a problem regarding with the booking date...

Ok, lets say i'm booking a table on the 7th of october at 7.00pm which is 2 days from today...once i book the table it is booking from today...the timer runs from now until the 7th of october at 7.00pm...i want the timer to run at 6.00pm on 7th of october any idea how to solve this problem...here is my code

the reservation confirm button

Private Sub ButtonA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CBButton1.Click
        Dim time1 As DateTime
        time559 = FormatDateTime("5:00:00 PM", DateFormat.LongTime)
        time1001 = FormatDateTime("10:01:00 PM", DateFormat.LongTime)
        time1 = FormatDateTime(Hour(Btime1.Value) & ":" & Minute(Btime1.Value))
        If time1 < time559 Or time1 > time1001 Then
            MsgBox("Booking Time is only available from 6.00 PM to 10.00 PM ")
        ElseIf Bdate1.Value < Today Then
            MsgBox("Error date is a past date, Enter again")
            PListBox1.Items.Add("Customer Name" & ControlChars.Tab & _
            ControlChars.Tab & "Booking Date" & ControlChars.Tab & _
            ControlChars.Tab & "Booking Time")
            status1 = "Booked"
            Table1.BackColor = Color.Khaki
            PListBox1.Items.Add(Bcusname1.Text & ControlChars.Tab & _
            ControlChars.Tab & ControlChars.Tab & Bdate1.Value & ControlChars.Tab & _
            ControlChars.Tab & FormatDateTime(Btime1.Value, DateFormat.LongTime))
        End If

the timer code...

Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        Dim btimeA As DateTime
        Dim bdateA As DateTime
        bdateA = FormatDateTime(Bdate1.Value, DateFormat.ShortDate)
        btimeA = FormatDateTime(Btime1.Value, DateFormat.LongTime)
        If FormatDateTime(TimeOfDay, DateFormat.LongTime) = btimeA.AddMinutes(20) And FormatDateTime(Today, DateFormat.ShortDate) = bdateA Then
            MsgBox("Booking Time up Mr/Miss " & Bcusname1.Text & " is late,reservation canceled")
            Table1.BackColor = Color.PaleGreen
            status2 = "Available"
        End If

thank u for ur help....

8 Years
Discussion Span
Last Post by debasisdas
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.