RecordsetClone & Workspace

C

Clyde

I have a"cboFind" combo box that works perfectly until invoked after a
"ws.CommitTrans". The cbo afterupdate event uses a recordsetclone in
typical find code to find the selected record.

One thing the code does between BeginTrans and CommitTrans affects the
records of cboFind (property is repod from an owner and returned to
inventory, PropID remains the same but CustID is changed). BTW this code is
called by a cmdRepo button, nothing to do w/ the cbo.

After the "repo" code is invoked the cbo code returns "3420 Object invalid
or no longer set" This occurs in the line rs.find etc. Using the immediated
window I have verified that the rs object is valid and set (by assigning it
to a tbl). So the invailid obj is the Recordsetclone.
I'm pretty sure the problem is the form's recordsource is left in some kind
of problem state for the Recordsetclone obj because simply closing the main
form and reopening fixes the problem completely ie the cboFind works just
fine.

My code includes Requerys on the cboFind form so I'm surprised that doesn't
fix it the same as closing and reopening.

Sorry to be so long winded. Have spent several hours on this with no
success.. any suggestiions would be appreciated.
 
C

Curis

On what line is the VBA code breaking?

Also, regarding your workspace object (ws), if you set it to the default
workspace and the subsequently issued a ws.Close command, that could easily
cause some issues like what you are experiencing. There is probably no need
to explicitly close it; just set it Nothing.

- Jeff
 
C

Clyde

Allen and Jeff, you guys were spot on. I changed ws.close to set ws =
nothing and it worked perfectly. I just knew it had to have something to do
with the ws. Thanks a lot for your help.
BTW it was breaking on the rs.find line.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top