data from one form to another

  • Thread starter Thread starter lynette
  • Start date Start date
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.
 
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.
 
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!
 
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.
 
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.
 
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.
 
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.
 
Back
Top