Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: copy value of textfield from an active form to another textfield in another open form


Message #1 by "clarita" <clarita@p...> on Mon, 27 May 2002 07:42:41
How to record the value of textfield in an active form to another 
textfields in another form so that the source tables of both forms will
be the same.

example:
 Table1      Table2    
   x=10      x 
   y=5       y

The values from Table1 will be the values of the textfields in 
 Table2.

Or what's the best way to do it. Make the values of several fields in 
 two Tables the same

please Help me...

Thanks in advance....
 clarita 
Message #2 by "Wesley Kendrick" <wez.k@n...> on Mon, 27 May 2002 22:24:35 +0100
Hi Clarita

You can do this without involving a second form, if you wish.  You can use
an Update Query. This is a query that updates fields in a table according to
values taken from another source, like a form.

1.    Create a Select Query containing the fields in the table you want to
update.
2.    Open the query in design view, and select 'Update Query' from the
Query Types menu
3.    In the new 'update' row, which appears in your query, insert the names
of the fields on your form which contain the values you want
inserted onto the second table. (The names have to have the full syntax, eg
"Forms!YourForm!YourField" - remember to enclose a name         in square
brackets if it contains any spaces  ie [Your Form]).
4.    You can view the results of the query by clicking on the 'View'
toolbar button (has an icon that looks like  a table)
5.    You can run the query from design view by clicking on the 'Run'
toolbar button  (has an icon like this ' ! ')  When you do this, you should
find that your second table now contains the values from your fields.
6.    You can trigger the query in a number of ways, by the 'on change'
event of a field, or with a button for instance.

If you must use a second form, you will need to write some code that loads
the values from the first form to the second form.  This is not difficult,
but its not as good a solution as the above. Hope this helps.

Regards, Wesley Kendrick


----- Original Message -----
From: "clarita" <clarita@p...>
To: "Access" <access@p...>
Sent: Monday, May 27, 2002 7:42 AM
Subject: [access] copy value of textfield from an active form to another
textfield in another open form


> How to record the value of textfield in an active form to another
> textfields in another form so that the source tables of both forms will
> be the same.
>
> example:
>  Table1      Table2
>    x=10      x
>    y=5       y
>
> The values from Table1 will be the values of the textfields in
>  Table2.
>
> Or what's the best way to do it. Make the values of several fields in
>  two Tables the same
>
> please Help me...
>
> Thanks in advance....
>  clarita
>

Message #3 by "clarita" <clarita@p...> on Wed, 29 May 2002 04:08:45
> Hi Clarita

You can do this without involving a second form, if you wish.  You can use
an Update Query. This is a query that updates fields in a table according 
to
values taken from another source, like a form.

1.    Create a Select Query containing the fields in the table you want to
update.
2.    Open the query in design view, and select 'Update Query' from the
Query Types menu
3.    In the new 'update' row, which appears in your query, insert the 
names
of the fields on your form which contain the values you want
inserted onto the second table. (The names have to have the full syntax, eg
"Forms!YourForm!YourField" - remember to enclose a name         in square
brackets if it contains any spaces  ie [Your Form]).
4.    You can view the results of the query by clicking on the 'View'
toolbar button (has an icon that looks like  a table)
5.    You can run the query from design view by clicking on the 'Run'
toolbar button  (has an icon like this ' ! ')  When you do this, you should
find that your second table now contains the values from your fields.
6.    You can trigger the query in a number of ways, by the 'on change'
event of a field, or with a button for instance.

If you must use a second form, you will need to write some code that loads
the values from the first form to the second form.  This is not difficult,
but its not as good a solution as the above. Hope this helps.

Regards, Wesley Kendrick


Hello Wesley,

     Thanks for the Information, I try to Update the value Table2 to the 
Table1 but it doesnt work, maybe I missed something in my codes ,actually 
I setvalue using "macro" the value of several textfields, from form1 
textfield(table1) to form2 textfield [table2]. How could I set their value 
so that if table2 or table1 increment their values of several textfield 
then the other table will also increment.


 example:
  Table1      Table2
    x=10      x
    y=5       y

 The values from Table1 will be the values of the textfields in
  Table2 "vice versa"

 Or what's the best way to do it. Make the values of several fields in
  two Tables the same, 

 GOD BLESS..

 Thanks in advance....
  clarita
 

  Return to Index