Visual Basic Run-time error '3420'

V

Valeriy

Hi, Help Pls Immediatly!

Access 2002 SP2 MUI on Windows Server 2003
Jet 4 SP7 installed after Office.

From some form code execution as follows

Forms![frm]![subfrm].Form.Requery

after any other form requery raise error

Microsoft Visual Basic
Run-time error '3420'
"Object is invalid or dsnt exists"

Thanks in advance,
Valeriy Danilov
 
T

Tim Ferguson

From some form code execution as follows

Forms![frm]![subfrm].Form.Requery

after any other form requery raise error

Microsoft Visual Basic
Run-time error '3420'
"Object is invalid or dsnt exists"

Okay: have you misspelt the "frm" form name or the "subfrm" control name?
What happens if you do a

With application
with .Forms("frm")
with .controls("subfrm")
.Form.Requery

end with
end with
end with

-- which line fails?


Tim F
 
V

Valeriy

Tim, Thanks,
but fails line
.Form.Requery

Heeeelp!!!

-----Original Message-----
From some form code execution as follows

Forms![frm]![subfrm].Form.Requery

after any other form requery raise error

Microsoft Visual Basic
Run-time error '3420'
"Object is invalid or dsnt exists"

Okay: have you misspelt the "frm" form name or the "subfrm" control name?
What happens if you do a

With application
with .Forms("frm")
with .controls("subfrm")
.Form.Requery

end with
end with
end with

-- which line fails?


Tim F

.
 
T

Tim Ferguson

but fails line
.Form.Requery

According to Help,

- Controls based on a query or table include:
-
- List boxes and combo boxes.
-
- Subform controls.
-
- OLE objects, such as charts.
-
- Controls for which the ControlSource property....


so you could try getting rid of the .Form reference and just requerying the
control itself.

Failing that.... I assume that subfrm really _is_ a subform control? What
is its recordset?

B Wishes


Tim F
 
V

Valeriy

Tim, thanks.
Yes, it _is_ subform control.

That subform based on a query with linked MS SQL Server
2000 (SP2) table. This project containes 100s forms same
type as this, but only this form failes. Query text as
follows:

SELECT DISTINCTROW dbo_cargo_full.id,
dbo_cargo_full.id_dept, dbo_cargo_full.sale_weight
FROM dbo_cargo_full
WHERE (((dbo_cargo_full.id_dept)=IIf(IsNull([Forms]![frm]!
[id_dept]),[id_dept],[Forms]![frm]![id_dept])) AND
((dbo_cargo_full.invoice) Like [inv]) AND
((dbo_cargo_full.name) Like [name]) AND
((dbo_cargo_full.state)<>6) AND
((dbo_cargo_full.id_supplier)=IIf(IsNull([Forms]![frm]!
[id_sup]),[id_supplier],[Forms]![frm]![id_sup])))
ORDER BY dbo_cargo_full.invoice_date DESC,
dbo_cargo_full.date_income DESC;
 
T

Tim Ferguson

WHERE (((dbo_cargo_full.id_dept)=
IIf(IsNull([Forms]![frm]![id_dept]),
[id_dept],
[Forms]![frm]![id_dept]))
AND ((dbo_cargo_full.invoice) Like [inv])
AND ((dbo_cargo_full.name) Like [name])
AND ((dbo_cargo_full.state)<>6)
AND ((dbo_cargo_full.id_supplier)=
IIf(IsNull([Forms]![frm]![id_sup]),
[id_supplier],
[Forms]![frm]![id_sup])))



I guess that I would be suspicious about all the references to the frm form
-- it sounds like a funny name for a form -- but if it works elsewhere then
it must be okay. I also have to wonder if it wouldn't be easier to use the
Access LinkingFields properties, but the same caveat applies.

In short then, I don't really know why the command is erroring out, but
this query is where I would start looking. Sorry I can't help more!

All the best

Tim F
 
W

William Scott

Subforms are NOT 'forms' within a Main Form ....they
are 'controls' within the main Form so the Dim subfrm
needs to be set as a CONTROL not a
Form..so...the 'control.name' (ie, the area on your main
Form where the subform will display) must be used as the
reference NOT the name of the subform that exists in your
Forms Tab in the database window. Hope this helps.
-----Original Message-----
From some form code execution as follows

Forms![frm]![subfrm].Form.Requery

after any other form requery raise error

Microsoft Visual Basic
Run-time error '3420'
"Object is invalid or dsnt exists"

Okay: have you misspelt the "frm" form name or the "subfrm" control name?
What happens if you do a

With application
with .Forms("frm")
with .controls("subfrm")
.Form.Requery

end with
end with
end with

-- which line fails?


Tim F

.
 

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