Macros

eramirez

New Member
Joined
Mar 13, 2003
Messages
14
Hi.

I am trying to add a Macro that sets the value of one field based on the value of another field. The field with the value already exists in the database. I added the new field that I want populated. For example.

CONDITION ACTION
[TYPE] IN ("ALDERMAN","CHA",VFC") SETVALUE

ITEM: [CATEGORY]
EXPRESSION: "COMMUNITY"

when I attach this macro to the TYPE field (in the event tab,"On Exit") and attempt to run, I get an error message saying that Access can't find the field "TYPE". I don't understand this since TYPE was already in the database (in the table and form). Does anyone know what I am missing or doing wrong?

Thanks
Enrique Ramirez[/code]
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Enrique

Are you sure the name of the control on the form is TYPE?
 
Upvote 0
pretty sure it is. The TYPE field I created in the table, then added it to the Form, the Name: TYPE and Control Source: TYPE. This is the message I get:

"Microsoft Access can't find the name 'TYPE' you entered in the expression.
You may have specified a control that wasn't on the current object without specifying the correct form or report context. To refer to a control on another form or report, preceded 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 belongs.
For example, Forms![Products]![Units in Stock]"


I am not even sure what this means.
 
Upvote 0

Forum statistics

Threads
1,214,817
Messages
6,121,720
Members
449,050
Latest member
MiguekHeka

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top