SetValue Macro

M

Marie

I am trying to use the SetValue Macro (inside of a macro)
to add a record and insert information into fields in a
table in an Access 2000 file. I am using the AfterUpdate
property of a control on a form to do this. I keep
getting the following error: "The object doesn't contain
the Autmation object "<filename>". You tried to run a
Visual Basic procedure to set a property or method for an
object. However, the component doesn't make the property
or method available for Automation operations.
Check the component's documentation for information on
the properties and methods it makes available for
Automation operations."

I have done this before in another database in a previous
version of Access and it worked like a champ. Can anyone
help me? There are multiple tables and relationships in
this database. The other one only had 2 or 3 tables in
it. Thanks.
 
S

Steve Schapel

Marie,

Please supply details of the macro.

- Steve Schapel, Microsoft Access MVP
 
M

Marie

The total macro is:
OpenTable: MiscPayments
GoToRecord: new
SetValue: Item:[MiscPayments]![Address ID]
Expression: Form![Main Address]![AddressID]
and so on.

I used the Expression builder to input the Item and
Expression.

The macro opens the table and goes to the new record,and
then gives me the error message when it gets to the
SetValue macro.

Marie
 
S

Steve Schapel

Marie,

The SetValue macro action only applies to Forms and Reports. You
can't use it in a Table.

In fact, the functionality for manipulating data in tables is
generally very limited. Tables are primarily for data storage, not
for data entry/editing/manipulation.

In any case, to use macro or code to copy data from one point to
another in a database is a very unusual thing. If you would care to
explain your purpose here, someone may be able to offer some advice on
an alternative approach.

- Steve Schapel, Microsoft Access MVP
 
Joined
Jul 18, 2007
Messages
3
Reaction score
0
Hi there, i am new to MS access so hopefully someone can help me as i have a purpose for the above. I wish to create an audit table that records any changes to a main database table. I also have a form linked to the main database table. I had hoped that i could run a macro after any form element has been updated using the 'AfterUpdate' trigger. In the macro i then planned to use the setValue function to add a row in the audit table but this appears not to work. Is there another way that this can be done?
 

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