SetValue Macro help

  • Thread starter Thread starter Kerry
  • Start date Start date
K

Kerry

I have two forms open. I want to set the value from a field on one form to a
field on the other, but I'm having trouble.

When I update the field I want the value to come from, then run the macro,
the value that populates the other form is the old information, not what I
just updated. I have to close the form that I updated, reopen it, and run
the macro again to get the updated information on the second form.

Does anyone know why this could be happening, and how I can get my update
into the other form?
 
Kerry,

First of all, I really need to say that your need to do this type of
operation is quite irregular, and almost certainly reflects a design
flaw in your application. I would recommend that you review your data
structure.

With that proviso, I would expect that you need to save the record
before the SetValue will work as required. Probably you can insert a
RinCommand/SaveRecord action into your macro, prior to the SetValue. If
this doesn't solve it, please let us know the exact entries you have for
the Item and Expression arguments of the SetValue action.
 
I tried saving prior to setvalue, but it still didn't work.

This is an HR database. Form A is required for every staff member and has a
free text field that is required. Form B only needs to be completed in
specific circumstances and has a free text field which is not required.
However if the field in Form B is populated, this information needs to
overwrite whatever is in the free text in Form A. (The information is coming
from two tables that are related.)

The macro is on close Form B, save form B, setvalue - item: field form A,
value: field form B.

Now, after that, when I go back to form A, the field will now have whatever
was in form B before when it was opened instead of when it was closed.
 
Kerry,

Ok, thanks for the clarification. However, it's probably good if you
could be a bit more precise in your description. For a start, forms
don't have fields. Forms have controls, which can be bound to fields,
and the fields are in tables. The SetValue action does not have a
"value" argument. It's called "Expression". So, can you please give
exact details of your macro. What are the actions? What are the
arguments? Show exact entries, using the real names of your forms and
controls. Just remember, you can see your database, but we can't, so we
rely on you to give us a picture of what you have there in front of you.
Thanks.
 
Back
Top