data from one form to another

L

lynette

hi! is there a way to transfer data from one form to
another form when opened?

scenario: user enters info into Form A. This form contains
a command button to open Form B. but theres no
relationship between their underlying tables. i just want
Data A & B etc. from Form A to take up Form B's Data C & D
etc... will an event procedure (ie Me!DataA = Me!DataC) in
the OnClick property do the job?

i am very new to access and have no programming backgound
whatsoever. hope you could also help me with the syntax.

thanks for the reply.
 
G

Guest

If you are using a macro to open the second form add to that macro to include the command SetValue for each field you need a value assigned.
 
J

John Vinson

hi! is there a way to transfer data from one form to
another form when opened?

scenario: user enters info into Form A. This form contains
a command button to open Form B. but theres no
relationship between their underlying tables. i just want
Data A & B etc. from Form A to take up Form B's Data C & D
etc... will an event procedure (ie Me!DataA = Me!DataC) in
the OnClick property do the job?

i am very new to access and have no programming backgound
whatsoever. hope you could also help me with the syntax.

thanks for the reply.

You may want to step back a bit.

Forms don't contain data. Forms are just windows, tools that let you
enter and edit data in Tables.

And if you're storing the same data in the table underlying FormB as
is already stored in the table underlying FormA, you're storing data
redundantly - always a BAD idea!

Could you explain what these tables are, how the information in the
tables is logically connected, and why you feel that you need to copy
the data from one table to another (via forms or in any other way)? It
can be done using some VBA code but this should very rarely be needed!
 
T

Tom Stoddard

Yes,

As long as both forms are open (you can hide either or both but they must be
open). Just use the syntax:

Forms!FormA.DataA = Forms!FormB.DataC

In this example FormA is the name of your form and DataA is the name of the
control on FormA that has the data you want to set. If the control is a
textbox this syntax will work. Form's default property is Value so the
statement could also be written as:

Forms!FormA.DataA.Value = Forms!FormB.DataC.Value

You might have to use a different propertie if you're using other types of
controls.
 
G

Guest

thanks a lot...works perfect!
-----Original Message-----
If you are using a macro to open the second form add to
that macro to include the command SetValue for each field
you need a value assigned.
 
G

Guest

thanks for taking time to reply to my message.
i'll keep your suggestion in mind. this is a lot simplier
than using a macro.
 
G

Guest

first of all thanks for taking time to reply to my posting.

the project that im working on is a sales order (SO)-job
order(JO) database. Form A is for SO and Form B is for JO.
SO is where sales personnel enters customer orders and
uses JO to place order for production purposes. thats why
similar data (i.e product, qty etc)from SO has to be
transfered to JO. It would have been ideal if i just link
the two tables but in our case its not only sales that
uses the JO but other departments too. JO has this
field 'REF NO' that could be SO_No if the order if from
sales, or RMA_No to replace customer returned products
etc. thus, the reason why im looking to transfer data to
one form to another is just to save sales personnel
entering same info twice.

if you have suggestion to improving the design of the
database, it will surely be appreciated.

thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top