Updating records and getting Runtime Error 3075
Hello there!
For the access program I am going to do, there is already an existing data. I had imported it from Excel. Now, I have created a URN field from the look up table and wanted to update it to the main table which comprises the existing data. I've used the following code but I keep on getting the Runtime Error 3075 message. Here is my code:
Private Sub Command0_Click()
Dim md As Recordset
Dim phr As Recordset
Dim entry As Recordset
Dim phrname As String
Dim mdname As String
Set md = CurrentDb.OpenRecordset("tblMDinfo")
Set phr = CurrentDb.OpenRecordset("tblPHRinfo")
Set entry = CurrentDb.OpenRecordset("tblEntryTrack")
phrname = phr("fldPHR")
mdname = md("fldMDName")
Do While entry.EOF = False
CurrentDb.Execute "update tblEntryTrack set [tblEntryTrack].[fldPHRID] = [tblPHRinfo].[fldPHRID] where [tblEntryTrack].[fldPHR] = " & phrname & ";"
CurrentDb.Execute "update tblEntryTrack set [tblEntryTrack].[fldMDID] = [tblMDinfo].[fldMDID] where [tblEntryTrack].[fldMDName] = " & mdname & ";"
Loop
MsgBox "done!"
End Sub
Help anyone?