G
Guest
I would like to insert the value of ClientID into a table via the following
code:
Set rs = db.OpenRecordset("SELECT c.ClientID FROM Client c WHERE c.groupID= 1)
InsertStr = "INSERT INTO m(ClientID, MYear) SELECT " & rs.ClientID & “, " &
plngMYr & " FROM MatchList m;â€
DoCmd.RunSQL Insertstr
WHen I try to run this, it does not recognize rs.ClientID. How do I refer to
the ClientID so that I can use that and insert into the second table? I am
running this in a loop.
code:
Set rs = db.OpenRecordset("SELECT c.ClientID FROM Client c WHERE c.groupID= 1)
InsertStr = "INSERT INTO m(ClientID, MYear) SELECT " & rs.ClientID & “, " &
plngMYr & " FROM MatchList m;â€
DoCmd.RunSQL Insertstr
WHen I try to run this, it does not recognize rs.ClientID. How do I refer to
the ClientID so that I can use that and insert into the second table? I am
running this in a loop.