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!

Query problem

Status
Not open for further replies.

coyote69

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

Part and Inventory Search

Sponsor

Back
Top