By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,501 Members | 831 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,501 IT Pros & Developers. It's quick & easy.

Carry over data fields from one form to another...

P: n/a
I have a simple problem, i just can get a grasp on it. I designed a
database for inventory of computer equipment. Now i created forms for
each table. Each piece of equipment is going to come in an order.
ORDERS --> ORDER CONTENTS --> DEVICES --> CPUS
--> PRINTERS
--> NETWORK HARDWARE

You get the picture. I want to make the updating easy. I start from
ORDERS table enter all the common information, then ORDER CONTENTS
table and get all that information in, and then i enter the
information for each specific device, and then the details on
different devices. I made a button on each form to go from one to the
other and thus it creates a new record for me in that table.

The question:

What i want to do is have the form ORDERS carry over the order number
(pk) to the next table i update, thus ORDER CONTENTS...and then i want
DEVICES table to carry over pc number to the next form, so it cuts
down on typing and it cuts down on possible errors user can
make...would anyone have any input i could use. Thank you so much...
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
DFS
Almir,

Sounds like each successive form opened is dependent on an ID of some type
from the
calling form?

So base the recordsource of the forms on a query which pulls data based on
the ID(s).

Main form recordsource: SELECT * FROM ORDERS;
2nd form recordsource: SELECT * FROM ORDER_CONTENTS WHERE OrderID =
Forms.MainForm.OrderID;
3rd form recordsource: SELECT * FROM DEVICES WHERE OrderID =
Forms.MainForm.OrderID AND ContentID = Forms.ContentForm.ContentID;
..... so on

These SELECTS depend on your db structure.
In the form control fields, you'll need to set some default values for the
foreign key that refer to the calling forms.

Default value in OrderID field on 2nd form: Forms.MainForm.OrderID
Default value in OrderID field on 3rd form: Forms.MainForm.OrderID
Default value in ContentID field on 3rd form: Forms.ContentForm.ContentID

Depending on your database structure, you may not need two defaults on your
3rd form.


"Almir" <al*****@yahoo.com> wrote in message
news:72**************************@posting.google.c om...
I have a simple problem, i just can get a grasp on it. I designed a
database for inventory of computer equipment. Now i created forms for
each table. Each piece of equipment is going to come in an order.
ORDERS --> ORDER CONTENTS --> DEVICES --> CPUS
--> PRINTERS
--> NETWORK HARDWARE

You get the picture. I want to make the updating easy. I start from
ORDERS table enter all the common information, then ORDER CONTENTS
table and get all that information in, and then i enter the
information for each specific device, and then the details on
different devices. I made a button on each form to go from one to the
other and thus it creates a new record for me in that table.

The question:

What i want to do is have the form ORDERS carry over the order number
(pk) to the next table i update, thus ORDER CONTENTS...and then i want
DEVICES table to carry over pc number to the next form, so it cuts
down on typing and it cuts down on possible errors user can
make...would anyone have any input i could use. Thank you so much...



Nov 12 '05 #2

P: n/a
al*****@yahoo.com (Almir) wrote in message news:<72**************************@posting.google. com>...
"Squirrel" <wi*****@covad.net> wrote in message news:<83*************************@msgid.meganewsse rvers.com>...
If you have a parent/child relationship between each of these tables, could
you
accomplish your goals by using subforms?

-L

No i can't use subforms, i already have subforms on each one of those
calling forms.


Looks like you might have to do something like a DCount to see if the
ID in question is already in your "child" table (I'm using "child"
somewhat loosely here... in the "subsequent" tables you'd carry the
Unique ID to). If it doesn't exist, you could open the form in
question and insert a new value. Just open the next form and assign
the value from the calling form...

In Form1
DoCmd.OpenForm "Form2"
Forms!Form2!IDField=Forms!Form1!IDField

or some such thing.
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.