T
tessaco via AccessMonster.com
I seem to be having a problem with an update query I am trying to run. I have
two tables, "Territories" and "Unique Territory" There are 60 entries in the
Territories table and I would like the Unique territory table to display one
territory at a time in order to run subsequent reports.
Here is my code:
Set rsterritory = CurrentDb.OpenRecordset("select distinct Territory from
[Territories] order by Territory")
Do While Not rsterritory.EOF
'update current territory table to the current record
CurrentDb.Execute ("Update [Unique Territory] set [Territory] = '" &
rsterritory!territory & "'")
Next
r = r + 1
rs.MoveNext
Loop
Set rs = Nothing
I'm not sure what I am doing incorrectly, but I would appreciate any help!
Thanks!!
two tables, "Territories" and "Unique Territory" There are 60 entries in the
Territories table and I would like the Unique territory table to display one
territory at a time in order to run subsequent reports.
Here is my code:
Set rsterritory = CurrentDb.OpenRecordset("select distinct Territory from
[Territories] order by Territory")
Do While Not rsterritory.EOF
'update current territory table to the current record
CurrentDb.Execute ("Update [Unique Territory] set [Territory] = '" &
rsterritory!territory & "'")
Next
r = r + 1
rs.MoveNext
Loop
Set rs = Nothing
I'm not sure what I am doing incorrectly, but I would appreciate any help!
Thanks!!