'Method 'Value' of object '_AccessField' failed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What's this error and how do I get rid of it
This error occurs at random times and mostly under Access Runtime (XP Running on Win2K SP4

Here's the SUB

Sub RecalcStr(frm As Form
If frm.Dirty Then frm.Dirty = Fals
Dim tbl As New ADODB.Recordse
tbl.Open "Select * From dbo.ItemDimWgt(" & frm!ID & ")", CurrentProject.Connection, adOpenStatic, adLockReadOnl
frm!UnitWeight = Nz(tbl!NewWgt) <------ Her
frm!Dimensions = Nz(tbl!NewDim) <------- And Here
tbl.Clos
End Su

The desperate :-(
 
Just a thought ;)

In a DAO recordset you need to .MoveFirst before you can get a value.
I thought the same applied to ADO


Daniel said:
What's this error and how do I get rid of it ?
This error occurs at random times and mostly under Access Runtime (XP Running on Win2K SP4)

Here's the SUB:

Sub RecalcStr(frm As Form)
If frm.Dirty Then frm.Dirty = False
Dim tbl As New ADODB.Recordset
tbl.Open "Select * From dbo.ItemDimWgt(" & frm!ID & ")",
CurrentProject.Connection, adOpenStatic, adLockReadOnly
 
When using Watch I can see that the two variables have correct values
It apears that the value of tbl!NewWgt cannopt be put into frm!UnitWeigh
 
I can't see much around for this problem.

The only thing I came across was this reference on
http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html

An error message in the format of Method <method name> of Object <object
name> Failed. This typically is caused by a problem with a programming type
library such as an invalid DAO DLL file. There are a number of articles on
the various forms of this message. Go to MSDN Online Search and do a look-up
on the specific message you're getting.
 
Peter Hoyle said:
Just a thought ;)

In a DAO recordset you need to .MoveFirst before you can get a value.
(snip)


Not so. A value is immediately available unless the recordset has zero
records.

TC
 
Have you thought that NZ requires at least 2 arguments. one value and value
if null.

I find with the Access runtime it has no (and provides no) error handling
capabilities. therefore apps must be bug free before distribution


Daniel said:
What's this error and how do I get rid of it ?
This error occurs at random times and mostly under Access Runtime (XP Running on Win2K SP4)

Here's the SUB:

Sub RecalcStr(frm As Form)
If frm.Dirty Then frm.Dirty = False
Dim tbl As New ADODB.Recordset
tbl.Open "Select * From dbo.ItemDimWgt(" & frm!ID & ")",
CurrentProject.Connection, adOpenStatic, adLockReadOnly
 
Back
Top