Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple date query help

Status
Not open for further replies.

coyote69

Technical User
Feb 19, 2002
45
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top