Form with Multiple Subforms? or Command Button??

J

jwr

COMMAND BUTTON:

I have 3 tables, customers, ship to, and issuing office. These forms are
related via customer ID. I am wanting to have a customer (main) form with 2
command buttons, one that opens the issuing office form, and one that opens
the ship to form. When each of these forms are open, I want only the
information pertaining to that particular customer. I created this main
form and added the command buttons, linked via customer ID. I get the
message that "cannot change or delete field because a related field is
required in Customer table". Even if I go completely off the customer form
after adding the new customer and before entering other information, and
then go back, I still get that message.

SUBFORMS:

I created the first form, customers, and it worked fine. I created one
subform, shipto, and then dragged it to the customer form. I entered the
shipto information in the subform - both ways --after creating customer and
closing form, and then subform, as well as inputting all information at the
same time. I can go back to previous customers that were already entered and
already had ship to information, but the only ship to information visible is
the very first one that I entered into the new subform. It does not stay
with the appropriate customer.

Questions:

1. Can I have more than 1 subform with a form?

2. Can the 2 subforms be "tied" to the customerID field in the customer
form? (Both subforms from tables have a relationship via customerID.)

3. When the customer form is open, I only want to see the information in my
subforms that pertain to that customer.

4. If multiple subforms will not work, why won't my command buttons work?

I used a command button because I did not want the other forms to be
visible at all times. If I use a subform, it is always open, isn't it, when
the main form is?I have been going around in circles trying to accomplish
this. It seems easy enough, but I am surely missing something. Please
help! My apologies if I have not made myself clear.

JR
 
M

Michel Walsh

jwr said:
COMMAND BUTTON:

I have 3 tables, customers, ship to, and issuing office. These forms are
related via customer ID. I am wanting to have a customer (main) form with
2
command buttons, one that opens the issuing office form, and one that
opens
the ship to form. When each of these forms are open, I want only the
information pertaining to that particular customer. I created this main
form and added the command buttons, linked via customer ID. I get the
message that "cannot change or delete field because a related field is
required in Customer table". Even if I go completely off the customer
form
after adding the new customer and before entering other information, and
then go back, I still get that message.

SUBFORMS:

I created the first form, customers, and it worked fine. I created one
subform, shipto, and then dragged it to the customer form. I entered the
shipto information in the subform - both ways --after creating customer
and
closing form, and then subform, as well as inputting all information at
the
same time. I can go back to previous customers that were already entered
and
already had ship to information, but the only ship to information visible
is
the very first one that I entered into the new subform. It does not stay
with the appropriate customer.

Questions:

1. Can I have more than 1 subform with a form?

2. Can the 2 subforms be "tied" to the customerID field in the customer
form? (Both subforms from tables have a relationship via customerID.)

3. When the customer form is open, I only want to see the information in
my
subforms that pertain to that customer.

4. If multiple subforms will not work, why won't my command buttons work?

I used a command button because I did not want the other forms to be
visible at all times. If I use a subform, it is always open, isn't it,
when
the main form is?I have been going around in circles trying to accomplish
this. It seems easy enough, but I am surely missing something. Please
help! My apologies if I have not made myself clear.

JR
 
M

Michel Walsh

Hi,
1. Can I have more than 1 subform with a form?

Yes. See [Customer Orders] form in Northwind
2. Can the 2 subforms be "tied" to the customerID field in the customer
form? (Both subforms from tables have a relationship via customerID.)

3. When the customer form is open, I only want to see the information in
my
subforms that pertain to that customer.

Set each subform as if it was alone

4. If multiple subforms will not work, why won't my command buttons work?

You probably try to add a NEW customer from a "child" table. As example, if
you are filling the DETAILS of an order, each ITEM to be included in the
order has probably to be added in the table of all the Items, before being
MENTIONNED in the table of details.

You can try to catch the error, asking if the end user want to add a new
customer (it may be a typo made by the user, so don't necessary add the
customer), and in the affirmative, open a form to add the customer, then
come back to the original job, now with the added customer.



Hoping it may help,
Vanderghast, Access MVP
 

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