Good day,
I'm trying to make a combined newrecord/update button for adding episodes to series, but it won't work.
Thanks to pbaldy for supplying me with the basis of the code
Any help is deeply appreciated
I'm trying to make a combined newrecord/update button for adding episodes to series, but it won't work.
Code:
Private Sub EpUpdater_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim x As Long
Set db = CurrentDb()
Set rs = db.OpenRecordset("tblAnimeEpisode", dbOpenDynaset)
For x = Me.txtStart To Me.txtEnd
If DCount("AnimeEpisodeID", "tblAnimeEpisode", "AnimID=" & [AnimeID] & " AND EpID=x") = 0 Then
rs.AddNew
rs!AnimID = Me.AnimeID
rs!EpID = x
rs.Update
End If
Next x
MsgBox "Process complete"
Set rs = Nothing
Set db = Nothing
End Sub
Any help is deeply appreciated