I just want to update the current record. The data base is bound to VB
this check for matching date and time in the field but update the first record in the field and not the one that I have selected.
Private 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
this check for matching date and time in the field but update the first record in the field and not the one that I have selected.
Private 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