Mike Vytal
Registered User.
- Local time
- Today, 06:11
- Joined
- Feb 1, 2007
- Messages
- 34
The highlighted line is where the problem lies. I've made sure MS DAO 3.6 object library, VB for Apps, MS Access 9.0 library, OLE automation, and MS Data ActiveX Data Objects 2.1 Library under Tools---->References are all selected. What am I missing or doing wrong? Thanx in advance for your help.
If Not IsNull(Me.txtLastName) And Not IsNull(Me.txtFirstName) Then
strContact = Me.txtLastName & Me.txtFirstName
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Participants", 2)
rst.Find "[LastName] & [FirstName] Like '*" & strContact & "*'"
With rst
If rst.NoMatch Then
.Close
GoTo Exit_txtFirstName_BeforeUpdate
Else
If MsgBox("A " & !FirstName & " " & !LastName & " already exists. Continue update?", 260) = vbYes Then
.Close
GoTo Exit_txtFirstName_BeforeUpdate
Else
Cancel = True
Me.Undo
.Close
End If
End If
End With
End If
If Not IsNull(Me.txtLastName) And Not IsNull(Me.txtFirstName) Then
strContact = Me.txtLastName & Me.txtFirstName
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Participants", 2)
rst.Find "[LastName] & [FirstName] Like '*" & strContact & "*'"
With rst
If rst.NoMatch Then
.Close
GoTo Exit_txtFirstName_BeforeUpdate
Else
If MsgBox("A " & !FirstName & " " & !LastName & " already exists. Continue update?", 260) = vbYes Then
.Close
GoTo Exit_txtFirstName_BeforeUpdate
Else
Cancel = True
Me.Undo
.Close
End If
End If
End With
End If