Access SetValue Action

  • Thread starter Thread starter A.C
  • Start date Start date
A

A.C

Help with SetValue Action

I have a relational database in access 2003 with 2 tables Customers and
Lawn Treatment Service Dates. In the customer table I have a text field
named “1 completed” that I want to populate with the word “Complete”
when I enter the number 104 in a data entry form for the field named
app# also text field from Lawn Treatment Service Dates Table.
I have created a macro and attached it to the after update property of
the app# field,with the Condition- [app#]=104, Action -SetValue ,
Item-[customer]![1 complete] and Expression- “complete”. This give me a
error message that the object doesn’t contain the automation object
‘customers’

Thanks A.C.
 
A.C.,

The SetValue action can not be applied to a table. In any case, the
expression [customer]![1 complete] is not valid syntax. If the field
you want to enter the "complete" value into is represented by a
control on a form, you can use SetValue. If it is on the active form,
i.e. the one the macro is called from, the macro Item argument will
simply be [1 complete], otherwise you will need syntax such as
[Forms]![NameOfForm]![1 complete]

As a side issue, it is not a good idea to use a # as part of the name
of a field, and I would recommend to change this.

- Steve Schapel, Microsoft Access MVP
 
Back
Top