Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 4729

If rs.recordcount < 1 Then it seems not to be working it creates duplicates in symptomcode table.

$
0
0
Private Sub ErrorCode_AfterUpdate()
Dim db As DAO.Database
Set db = CurrentDb
Dim rs As DAO.Recordset
Dim strsql As String
strsql = "SELECT* from errorcode where symptomcode =" & Me.[ErrorCode] & "'"
Set rs = db.OpenRecordset("errorcode", dbOpenDynaset)
If rs.recordcount < 1 Then
Else
rs.AddNew
rs!symptomcode = Me.[ErrorCode]
rs.Update
End If
rs.Close
db.Close
Me.ErrorCode.Requery
End Sub

Viewing all articles
Browse latest Browse all 4729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>