
Originally Posted by
June7
You are referencing a recordset rsSelect for an input parameter? Try:
rsSelect("luid")
or
rsSelect!luid
And you are updating a field in recordset rsInsert? Why would you save this calculated result to table?
Post your complete procedure if you need more help.
That removes the error, but no data is insert into the table
Full on syntax
Code:
DoCmd.RunSQL ("Create Table [_Vendor1] (loggedinuserid text, profencyScoretext);")
Dim rsSelect As DAO.Recordset
Dim rsInsert As DAO.Recordset
Dim db As DAO.Database
Set db = CurrentDb
Set rsSelect = db.OpenRecordset("Select DISTINCT " & luid & " FROM [SchoolData]")
Set rsInsert = db.OpenRecordset("_Vendor1")
Do While Not rsSelect.EOF
rsInsert.AddNew
rsInsert!loggedinuserid = rsSelect(luid).Value
rsInsert![ProfencyScore] = ConcatRelated("" & userIDField & "", "SchoolData", "" & luid & " = " & rsSelect(luid).Value)
rsInsert.Update
rsSelect.MoveNext
Loop