Change Yes/No Value with Macro

kujeremy

Registered User.
Local time
Today, 16:42
Joined
Oct 16, 2009
Messages
28
Hello,
I am working on a Query that will run, and once it does it will change the value of a Yes/No box from "Yes" to "No"
I have everything set up and working as I require except for the change part. What I have been trying so far as part of the Macro to run the report is:

Action : SetValue
Item: [table name]![Field Name]
also tried Item: [Query name]![Field name]
Expression: 0

When I do this I receive the message:

Access can't find the name 'Table Name' you entered in the expression.
You may have specified a control that wasn't on the current object wihtout specifying the correct form or report context.
To refer to a control on another form or report, precede the control name with the name of a collection, usually either forms or reports, and the name of the form or report to which the control belonds. For example, Forms![Products]![Units in stock}

Thanks for any assistance!
 
I don't use macros, but to the best of my knowledge, SetValue can't set the value in a table or query. If you have a form control bound to that field you can set that. Otherwise, you'll either need to execute an update query to change the value or do it with a recordset in VBA code.
 
If you are running a query to update the values, you just need to use OPENQUERY macro command. The query will have to pull the value for update from something else (like a form as an example).
 
Great, thanks you two. It looks like I'll be able to get the results I need by using the update query.
 

Users who are viewing this thread

Back
Top Bottom