NoMatch doesn't seem to be working??

krc777

Registered User.
Local time
Today, 09:57
Joined
Nov 29, 2005
Messages
70
I have the following lines:

Set rst3 = db.OpenRecordset("SELECT * from MainRptDataASD where PlanID = " & MyPlanID & " and PmtYr = " & mypmtyr & " and Ltrim(ASD) = ' " & myASD & " ' and Ltrim(IPR) = ' " & myIPR & " '")
If rst3.NoMatch Then
CurrentDb.Execute "INSERT into MainRptDataASD(PlanID, PmtYr,IPR, ASD) VALUES(' " & MyPlanID & " ' , ' " & mypmtyr & " ' , ' " & myIPR & " ' , ' " & myASD & "')"
End If

The rst3.nomatch doesn't seem to work. Even though there is no matching record meeting the above criteria it never performs the INSERT.
 
From VBA help:
NoMatch Property
Indicates whether a particular record was found by using the Seek method or one of the Find methods (Microsoft Jet workspaces only).
I don't see where you have used the Seek or the Find method.
 

Users who are viewing this thread

Back
Top Bottom