Hello,
I'm wondering how I can get the ID of a matching record and use this ID in an AddNew loop.
Thanks to pbaldy for supplying the base of the code
Basically I want to use the ID which matches the criteria "Episode " & x. Getting the fldEpisodeID where fldEpisodeName = "Episode " & x from tblEpisodeList - how can I do this?
Thanks in advance
I'm wondering how I can get the ID of a matching record and use this ID in an AddNew loop.
Code:
Private Sub cmdAdd_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
rs.AddNew
rs!AnimID = Me.AnimeID
rs!EpID = ?
rs.Update
Next x
MsgBox "Process complete"
Set rs = Nothing
Set db = Nothing
End Sub
Basically I want to use the ID which matches the criteria "Episode " & x. Getting the fldEpisodeID where fldEpisodeName = "Episode " & x from tblEpisodeList - how can I do this?
Thanks in advance