I want to be able to check an appointment date in a field in an access dbase. If that date is taken then I wnat ot display a message. If it is not taken I want to update the record that i am view in the form. this attached works except it updates the first record in the table and not the one i want
rivate Sub apptcheck()
Dim upDateAppt As String
upDateAppt = InputBox("Enter new appointment date and time", " _/_/__, _ am/pm"
On Error GoTo errorhandler
datContactManager.Recordset.FindFirst "apptdate = #" & upDateAppt & "#"
On Error GoTo errorhandler
If (datContactManager.Recordset.NoMatch = False) Then
'msgbox display if date is not available
MsgBox "That appointment time is not Available"
Exit Sub
End If
If datContactManager.Recordset.NoMatch = True Then
txtAppointmentDate = upDateAppt
End If
errorhandler:
Exit Sub
End Sub
rivate Sub apptcheck()
Dim upDateAppt As String
upDateAppt = InputBox("Enter new appointment date and time", " _/_/__, _ am/pm"
On Error GoTo errorhandler
datContactManager.Recordset.FindFirst "apptdate = #" & upDateAppt & "#"
On Error GoTo errorhandler
If (datContactManager.Recordset.NoMatch = False) Then
'msgbox display if date is not available
MsgBox "That appointment time is not Available"
Exit Sub
End If
If datContactManager.Recordset.NoMatch = True Then
txtAppointmentDate = upDateAppt
End If
errorhandler:
Exit Sub
End Sub