Long time FileMaker Pro solution builder, but I have to create a solution in MS Access at work.
The paradigm shift has me often befuddled.
What I'm trying to do:
I have four fields: Attributed, State, Locale and SourceID
I want to create SourceID values automatically when I key in Attributed values. SourceID needs to be constructed from a portion of the Attributed field with state and Locale appended.
The struggle so far:
- On a datasheet view of the table in question, I can use a Before Entry Data Macro to set the SourceID field. Unfortunately, it only populates when leaving the current record. Annoying. Also, I want to be able to do this from a form most of the time.
- On a form bound to the table, tried various Event approaches to updating the SourceID field, but it won't allow me to use "setfield" ... says it can't be used in the current context.
So ... I'll try to resist the urge to ask why setfield is so dang hard to use. Skip that: how do I use a macro to set a field value, from a form, triggered automatically when I exit the field (not when I exit the record)?
Oh, I also tried to create a named macro, since Event on a form seemed to want that. Sure enough, in a named macro, can't use setfield either. Doesn't even appear in the actions catalog.
Edit: I should mention -- reason I'm not using a calculation field is that I need to use SourceID in a relationship to another table.