Buttons and Forms

T

tklambStudent

I have 4 tables, Owners, Pets, Services and Billing. Owners has a one to many
relationship with Pets and Billing. Pets has a one to many relationship with
Services. (All have the ref integ and cascade update checked)

Why can't I just create a button in the Owners form that will open up the
Pets form with it's services subform and have the OID update automatically in
the Pets form. It seems the only way that OID will update (It's a PK in the
Owners table and FK in the Pets table) is if I create a subform and place it
inside the Owners form. Same with the Billing table, it appears that is has
to be inside the Owners form for the OID to update. (PK in Owners, FK in
Billing)

My Owners form is getting pretty darn crowded with all of these
subforms..and another thing, the Pets form is not really a subform. It does
have the subform of services inside it, but the Pet form itself is just a
form. I dragged the whole form inside the Owners form. That was the only way
to get the OID and PID to update in the Pets form and Services form. If I had
3 little subforms (datasheets) the OID would update, but the Services subform
didn't seem to understand to update the PID, probably because it is linked to
the Pets table. (PK in Pets and FK in Services)

I just thought once the relationships were established the forms didn't have
to be inside each other to work. I hope someoone can explain this.
 
S

Stefan Hoffmann

hi,
Why can't I just create a button in the Owners form that will open up the
Pets form with it's services subform and have the OID update automatically in
the Pets form.
Take a closer look at the DoCmd.OpenForm method. You can either use the
Filter or Criteria parameter. E.g.

DoCmd.OpenForm "allYourPetsForm", , , "OwenerID = " & Me![ID]


mfG
--> stefan <--
 
A

Arvin Meyer [MVP]

If it's a many side table, it is usually represented with a subform. You can
have multiple tabs in a tab control to house your subforms, and they can be
nested several levels (more than you will need).

You can do what you want, but if you want the OID in the Pet table, you'll
either need to code it in, or use a linked subform.
 
T

tklambStudent

I am really new to this, so I am not sure what exactly you are telling me to
do.

Stefan Hoffmann said:
hi,
Why can't I just create a button in the Owners form that will open up the
Pets form with it's services subform and have the OID update automatically in
the Pets form.
Take a closer look at the DoCmd.OpenForm method. You can either use the
Filter or Criteria parameter. E.g.

DoCmd.OpenForm "allYourPetsForm", , , "OwenerID = " & Me![ID]


mfG
--> stefan <--
.
 
T

tklambStudent

My Owner table is on the one side to the one to many. My pets table is
connected to it--so it would be on the many side. The Service table is
connected to the Pet table so it is on the many side, but as for the Pet
table in that scenario, it is on the one side.

I am very new to this, I don't even know how to set it up as tabbed. I'm
assuming tabbed, means the little tabs across the top.

Can a form have another form inside it--I know it works as far as updating
the necessary key fields--but it looks rather stupid. Is there another way to
do this? I would really like it if I could just click a button and it would
open and update the necessary fields in the form. I wonder if a combo box
would work?
 
A

Antonieta Willumsen

If it's a many side table, it is usually represented with a subform. You can
have multiple tabs in a tab control to house your subforms, and they can be
nested several levels (more than you will need).

You can do what you want, but if you want the OID in the Pet table, you'll
either need to code it in, or use a linked subform.
 

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