N
Nicholas Scarpinato
I have a function that checks a record's Status field and, based on the
status, calls a status-specific Sub. My problem is I don't know how to make
the Sub see the current record in the recordset opened by the Function. I
could write all the code inline in the function, but it would get rather
cumbersome. I won't list the entire code due to it's length, but the gist of
it is this:
Function RejectedItemOptionSelect()
.... DIM's, etc ...
Set db = CurrentDB()
sql = "SELECT * FROM [Main Returns Table]"
Set rs = db.OpenRecordSet(sql)
With rs
..MoveFirst
Do Until .EOF
If .Fields("Status") = "Resubmit to correct vendor" Then Call BinLocationReset
If .Fields("Status") = .... etc ...
When I call BinLocationReset, I want to work with the current open record in
recordset "rs". But attempting to use rs.Edit in my Sub gives me an Object
Required error, and if I use .Edit, I get an Invalid or Unqualified Reference
error.
Do I need to Global "rs"?
status, calls a status-specific Sub. My problem is I don't know how to make
the Sub see the current record in the recordset opened by the Function. I
could write all the code inline in the function, but it would get rather
cumbersome. I won't list the entire code due to it's length, but the gist of
it is this:
Function RejectedItemOptionSelect()
.... DIM's, etc ...
Set db = CurrentDB()
sql = "SELECT * FROM [Main Returns Table]"
Set rs = db.OpenRecordSet(sql)
With rs
..MoveFirst
Do Until .EOF
If .Fields("Status") = "Resubmit to correct vendor" Then Call BinLocationReset
If .Fields("Status") = .... etc ...
When I call BinLocationReset, I want to work with the current open record in
recordset "rs". But attempting to use rs.Edit in my Sub gives me an Object
Required error, and if I use .Edit, I get an Invalid or Unqualified Reference
error.
Do I need to Global "rs"?