Hello,
I have a long script that takes records from one table and puts them into another table depending on the "companytype", "cycle", "functionalarea" and "companyuser"
this site is for admins of the different companies, one company can have multiple "companyuser"
So for example company xyz has a "companyuser" named Joe.
Joe belongs to
"companytype" Home
"cycle" Expenses
"functionalarea" Dine Out
When an admin for company bbb logs in he can see all his questions properly but if he logs in again it loads Joe into the "companyuser" field for the "cycle" and "funcitionalarea" of company bbb.
I have narrowed to the folloing part of my code
what I was thinking in doing was to add this
but I get the following error
Not sure how to go about fixing this one any help is much appreciated!!!
I have a long script that takes records from one table and puts them into another table depending on the "companytype", "cycle", "functionalarea" and "companyuser"
this site is for admins of the different companies, one company can have multiple "companyuser"
So for example company xyz has a "companyuser" named Joe.
Joe belongs to
"companytype" Home
"cycle" Expenses
"functionalarea" Dine Out
When an admin for company bbb logs in he can see all his questions properly but if he logs in again it loads Joe into the "companyuser" field for the "cycle" and "funcitionalarea" of company bbb.
I have narrowed to the folloing part of my code
Code:
set rstmpmy = dal_users.Query(" cycle='" & rstmp("cycle") & "' and functionalarea='"&rstmp("functionalarea")&"'","")
if not rstmpmy.eof then
dal_answers.Param("itm")= rstmp("itm")
dal_answers.Value("companyuser")=rstmpmy("companyuser")
strUpdate = "update answers set companyuser='"&rstmpmy("companyuser")&"' where itm in (select itm from questions where cycle='"&rstmp("cycle")&"' and functionalarea='"&rstmp("functionalarea")&"')"
CustomQuery(strUpdate)
dal_answers.Update()
end if
rstmpmy.close
set rstmpmy=nothing
what I was thinking in doing was to add this
Code:
elseif
if not rstmpmy.eof then
dal_answers.Param("itm")= rstmp("itm")
dal_answers.Value("companyuser")=rstmpmy("companyuser")
strUpdate = "update answers set companyuser='"&rstmpmy("companyuser")&"' where itm in (select itm from questions where cycle='"&rstmp("cycle")&"' and functionalarea='"&rstmp("functionalarea")&"')"
CustomQuery(strUpdate)
dal_answers.Update()
Code:
Error Type:
ADODB.Field (0x80020009)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
Not sure how to go about fixing this one any help is much appreciated!!!