Access 2000

  • Thread starter Thread starter Tom Waki
  • Start date Start date
Sounds like you are using the EditMode property improperly!

Perhaps you are trying to change the editmode property. You can't do that. Or maybe you're using the editmode property on an object that does not have such a property.

But really it's impossible to say because you didn't give the code snippet which troubles you so, therefore those of us which are not omniscient can at best guess.
 
-----Original Message-----
Sounds like you are using the EditMode property improperly!

Perhaps you are trying to change the editmode property.
You can't do that. Or maybe you're using the editmode
property on an object that does not have such a property.
But really it's impossible to say because you didn't give
the code snippet which troubles you so, therefore those of
us which are not omniscient can at best guess.
Thank you for your response. I hope the following will
help.
I am using Microsoft Access 2000 (9.0.2720).
I would like to update a field in a query.
Here is my code:

Function CalcOrderCumTotal()

Dim db As DAO.Database
Dim rst As Recordset
Dim mPONO As String
Dim mPOCUMQTY As Integer

Set db = CurrentDb()
Set rst = dbOpenRecordset("qryOrders", dbOpenDynaset)
With rst
rst.MoveFirst
mPONO = PONO
mPOCUMQTY = 0
rst.MoveNext
Do Until rst.EOF
If PONO = mPONO Then
rst.EditMode
POCUMQTY = mPOCUMQTY + POQTY
rst.Update
Else
rst.EditMode
POCUMQTY = POQTY
rst.Update
mPOCUMQTY = 0
mPONO = PONO
End IF
rst.MoveNext
Loop
Close
End With
End Function
 
Two possible problems:

Dim rst as DAO.RecordSet

rst.Edit ' (not EditMode)

The first may not be needed if the DAO reference precedes the ADO reference
in your Reference List (but its a good idea to qualifiy it, anyway). The
second is the problem that's, for sure, giving you the error.

Larry Linson
Microsoft Access MVP
 
Larry, thank you. My code successfuly compiled. However,
I have another problem. I use a macro to excecute the
function: RunCode CalcOrderCumTotal(). The system
response with a message: The expression you entered has a
function that Microsoft Access can't find. Can you help?
Thanks.
 
I don't use macros except for, rarely, AutoKeys or AutoExec. However, if it
can't find your function, make sure the function is in a standard module.
You _may_ also need to make it a Public Function.

If the function name is spellled correctly in the macro, that's all I can
think of.

Larry Linson
Microsoft Access MVP
 
Back
Top