This is an application to remind someone to do things at a certain time of the day. There are sometimes more than one thing the person has to do at a particular time. You can see that from the example data from the field: Time_To_Check which has a cooresponding field called: Item_To_Check.
So, basically I'm try to alert the user with a popup message box that it's a certain time and to do required things now.
I'm trying to compare a field in an Access database to the current system time using the control Timer.
I'm getting the error: Object reference not set to an instance of an object
on this line of my code: Dim sdr As SqlDataReader = cmd.ExecuteReader
I've attached the code below.
Example of data in the Access field called: Time_To_Check
The data type is: Date/Time and the format is: hh:nn:ss
I'm using seconds so the popup will only happen once...follow my process??
Dim Time_Compare as String = Format(Now, "H:mm:ss")
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If conn.State = ConnectionState.Open Then
strSQL1 = "SELECT DISTINCT Time_To_Check FROM FirstShift_Checklist WHERE Time_To_Check = '" & Time_Compare & "'"
Dim sdr As SqlDataReader = cmd.ExecuteReader
If (sdr.Read()) Then
Catch ex As Exception