Hi guys
I'm trying to process records from a table based on the unique value of one field but my code fails at the last line shown below "Set rst2..." :
What am I doing wrong??
Public Function UpdatePrimary()
Dim db As DAO.Database
Dim rst1 As DAO.Recordset
Dim rst2 As DAO.Recordset
Dim strSQL1 As String
Dim strSQL2 As String
Set db = CurrentDb()
strSQL1 = "SELECT customer FROM Global_Sold_To GROUP BY customer"
Set rst1 = db.OpenRecordset(strSQL1)
rst1.MoveFirst
Do While Not rst1.EOF
strSQL2 = "SELECT sales_office, industry, distribution_channel, primary_owner FROM Global_Sold_To WHERE customer = rstunique!customer;"
Set rst2 = db.OpenRecordset(strSQL2)
rst2.MoveFirst...
The error I get is Run time error '3061' Too few parameters expected.
thanks
Tim
I'm trying to process records from a table based on the unique value of one field but my code fails at the last line shown below "Set rst2..." :
What am I doing wrong??
Public Function UpdatePrimary()
Dim db As DAO.Database
Dim rst1 As DAO.Recordset
Dim rst2 As DAO.Recordset
Dim strSQL1 As String
Dim strSQL2 As String
Set db = CurrentDb()
strSQL1 = "SELECT customer FROM Global_Sold_To GROUP BY customer"
Set rst1 = db.OpenRecordset(strSQL1)
rst1.MoveFirst
Do While Not rst1.EOF
strSQL2 = "SELECT sales_office, industry, distribution_channel, primary_owner FROM Global_Sold_To WHERE customer = rstunique!customer;"
Set rst2 = db.OpenRecordset(strSQL2)
rst2.MoveFirst...
The error I get is Run time error '3061' Too few parameters expected.
thanks
Tim