Transfer data between forms/tables

  • Thread starter Thread starter Clive
  • Start date Start date
C

Clive

Anyone know how to transfer data from one table to another
via two forms open at the same time? I tried doing this
using SetValue in a macro, but that didn't work for bound
controls. There has to be a way to do this.
Thanks.
 
Anyone know how to transfer data from one table to another
via two forms open at the same time? I tried doing this
using SetValue in a macro, but that didn't work for bound
controls. There has to be a way to do this.
Thanks.

Well, other than to say a) it's not the best way to transfer data from
one table to another (an Append query is much better) and b) that
you're not providing enough information to really help much (such as
the value your're using in the macro), I can't say much!
 
-----Original Message-----


Well, other than to say a) it's not the best way to transfer data from
one table to another (an Append query is much better) and b) that
you're not providing enough information to really help much (such as
the value your're using in the macro), I can't say much!


.
The SetValue arguments are as follows: Expression is a
control of one form and Item is a control of another
form. When the macro is run it should transfer or assign
the value of the Expression control to the Item control.
The two controls are of the same type, length, etc. If
the Expression control is unbound and the Item control is
bound, then this works, but if both are bound then it
doesn't work.

Clive
 
The SetValue arguments are as follows: Expression is a
control of one form and Item is a control of another
form. When the macro is run it should transfer or assign
the value of the Expression control to the Item control.
The two controls are of the same type, length, etc. If
the Expression control is unbound and the Item control is
bound, then this works, but if both are bound then it
doesn't work.

Do you get an error message? Does it just not change the value, or
what? Which Form has the macro attached, and to what event?
 
-----Original Message-----


Well, other than to say a) it's not the best way to transfer data from
one table to another (an Append query is much better) and b) that
you're not providing enough information to really help much (such as
the value your're using in the macro), I can't say much!


.

John,

Further explanation - The SetValue arguments in the macro
are as follows: Expression points to a control in the
first or "source" form while Item points to a control in
the second or "destination" form. This works to transfer
the contents of an unbound control of the first form
(Expression) to a bound control of the second form (Item),
but it does NOT work if the control of the first form is
also bound. This is what I'm trying to do. The controls
of both forms are of the same type, length, etc.

Clive
 
Further explanation - The SetValue arguments in the macro
are as follows: Expression points to a control in the
first or "source" form while Item points to a control in
the second or "destination" form. This works to transfer
the contents of an unbound control of the first form
(Expression) to a bound control of the second form (Item),
but it does NOT work if the control of the first form is
also bound. This is what I'm trying to do. The controls
of both forms are of the same type, length, etc.

That's very odd. I don't see why the bound or unbound status of the
control would make any difference!

I almost never use Macros, so it may be some quirk of SetValue which I
don't know. I'd suggest reposting the problem in the macros newsgroup
to see if anyone can help there, or recasting the event in VBA;
certainly in VBA you can say

Forms!Destinationform!controlname = Me!controlname

and it will copy the current contents of the control, bound or not.
 
Back
Top