I've been struggling for the past few hours and still can't get my head round this one . The issue I am having is when someone has been admitted the database updates giving them BedID , when I then try and discharge them I can't seem to set the BedID (In the database) to nothing . This is an issue as I need to be able to admit and discharge as many people as I can.
Sub Dis1_Click(ByVal s As Object, ByVal e As EventArgs) Handles Dis1.ServerClick
Dim time As String = Now().ToString("dd-MM-yyyy hh:mm:ss")
sql = "UPDATE Allocation SET BedID = NULL , DischargeDate =" + "'" + time + "'" + " WHERE BedID = 1 "
cmd = New OdbcCommand(sql, cn)
cmd.ExecuteNonQuery()
End Sub
Sub BedCheck1()
If r("BedID") = "" Then
Else
If r("BedID") = 1 Then
ba = s & "<tr><td>" & r("Surname") & "</td>" & "<td>" & r("Forename") & "/<td>" & "<td>" & r("AdmitDate") & "</td>" & "<td>" & r("DischargeDate") & "</td>" & "<td>" & r("comments") & "</td></tr>"
End If
End If
End Sub
Thanks!