Subform requery problem

B

Brenda

I'm getting an error "Object invalid or no longer set" when trying to
requery a subform in a button_click event on the main form. The main form is
unbound and has several controls that have values used in the subform's
query. The code line is:
Me.sfmDetails.Form.Requery
I have tried several different syntax variations, none work. This is a
Windows2000 server. The same mdb and code works perfectly on two different
WindowsXP pro machines. All are using AccessXP and the mdb is Access2000
format. I have tried converting it to AccessXP format and still have the
same problem.

Thanks in advance,
Brenda
 
S

S.L.

Hello, Check Tool>Reference in VB code for your Windows2K Server. It may
refer to invalid ADO or DAO or valid library but different version.
 
B

Brenda

Thanks for the reply, I've tried removing and replacing the references and
still same error. Also tried different library versions, still same error.
All machines have mdac 2.7 sp1 and jet4.0 sp8, also sql server 2000 sp3a,
and the error only happens on the Win2k server.
Brenda
 
D

Dan Artuso

Hi,
Is that the only line of code in the event?
If not, is that the line it breaks on?
 
S

S.L.

Does it use the same data as in other machines ?

Brenda said:
Thanks for the reply, I've tried removing and replacing the references and
still same error. Also tried different library versions, still same error.
All machines have mdac 2.7 sp1 and jet4.0 sp8, also sql server 2000 sp3a,
and the error only happens on the Win2k server.
Brenda
 
B

Brenda

No, I'm working with a different sql server with the machines that work
correctly. The query is using a sql server view, no joins. The offline sql
server is on the local machine running Access and is using a copy of the
live server database. If I open the subform's query from the database menu
when the form/subform is open, it opens with the correct records and no
error. When I click the command button on the form, I get the error and no
records.
 
S

S.L.

Very strange manner !!!

It seems that the name "sfmDetails" is not correct, Access can not find it.
Try set breakpoint at this line. When your code stop, open View>Locals
Window then expand the Me object and check all ItemXXX.Name under Me (look
for only type column = subform/subreport). Check that there is "sfmDetails"
in Name property. If you can not find it, something is incorrect. If you can
find it, problem should point to your data or recordsource of your subform.
Also try type "? Me.sfmDetails.Form.RecordSource" in immediate window when
your code stop at this breakpoint and check whether that query syntax is
correct or not.

And have you tried other format of this command "Me.sfmDetails.Form.Requery"
? Ex., Me!sfmDetails.Form.Requery or change your subform control's name to
"aaa" and test it.
 

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

Top