Hi,
im trying to compare time value of to two datetimepickers, i tried to use dt_Start.Value.TimeOfDay > dt_End.Value.TimeOfDay but it doesn't work.
btw, i trying to make a scheduler. here are some of my codes:
im trying to compare time value of to two datetimepickers, i tried to use dt_Start.Value.TimeOfDay > dt_End.Value.TimeOfDay but it doesn't work.
btw, i trying to make a scheduler. here are some of my codes:
Dim strUpdate As String If dt_Start.Value.Date > dt_End.Value.Date Then MsgBox("End date is earlier than Start Date. Please check.", vbExclamation, "Error!") ElseIf dt_Start.Value.Date < Today.Date Then MsgBox("Selected date is later than the current date. Please check.", vbExclamation, "Error!") ElseIf dt_Start.Value.Date <= dt_End.Value.Date Then [B]If dt_Start.Value.TimeOfDay > dt_End.Value.TimeOfDay Then[/B] [B] MsgBox("End time is earlier than the Start time. Please check.", vbExclamation, "Error!")[/B] ElseIf dt_Start.Value.TimeOfDay <= dt_End.Value.TimeOfDay Then If MsgBox("Do you want to save record?", MsgBoxStyle.YesNo + vbQuestion, "Save Record") = vbYes Then If rtxt_Desc.Text = "" Or cmb_Name.Text = "" Then MsgBox("Please fill-up ALL the necessary information.", MsgBoxStyle.Critical, vbOK) Else dt_Start.CustomFormat = "yyyy-MM-dd hh:mm:ss" dt_End.CustomFormat = "yyyy-MM-dd hh:mm:ss" strUpdate = "INSERT INTO tbl_sched(strdte, enddte, nme, des, status, dtecreate) VALUES('" + dt_Start.Text + "', '" + dt_End.Text + "','" + cmb_Name.Text + "', '" + rtxt_Desc.Text + "', '" + cmb_Status.Text + "',Now())" Con.noReturnQuery(strUpdate) 'MsgBox(strUpdate) MsgBox("Record Save.") Me.Close() End If End If End If End If End Sub