subform linker by field

Agent Smith

Registered User.
Local time
Today, 17:20
Joined
Nov 27, 2003
Messages
33
Hello every body;
sorry for stupid question.
i'm db explorer.

I have this table "estadias"where there are these fields:

Descontos; yes or no
Descontos; memo
estadia; number - primary key.

the problem is i want a subform to be called from the main by a button to be related by the estadia key; how do i do this?

available file by mail

:D
 
tblMain
EstadiaID (PK and Autonumber)
Descontos
MemoField
...Other fields...

tblSubTable
SubTableID (PK and Autonumber)
EstadiaID (FK long integer)
...other fields...

Do not name the Memo and Yes/No fields with the same names. The subform will automatically assume the correct Foreign Key when you move to a new record on the main form so you do not need to use any buttons.

hth,
Jack
 
didn´t quite explained the problem

The thing is the form with the memo field is suposed to popup as stand alone form, but keep linked to the record related "estadia nº".

This be:

if Desconts( yes or no) = yes

press button; or on click check box

respective memo field PopUp.
:rolleyes:

if you are willing i'll atach diagram

And : I understood the subtable idea, but never worked with "FK"s; what does it do, concerning tables.

thanks anyway for helping

Smith
 
Last edited:
built in what!!!

can you please explain what you mean.

i not know what is a zoom box.
can you describe hou to build one.

for doubts here is my relation diagram.
 

Attachments

  • sem-título-1.gif
    sem-título-1.gif
    26.4 KB · Views: 125
the form

here is the form i'm trying to build.

after seeing the relation diagram,
is possible to do what i wat; how.

this is very important to me

thanks for helping

Smith:)
 

Attachments

  • form1.jpg
    form1.jpg
    91.4 KB · Views: 137
If your Popup form is named 'Popup' then this code will open the popup at the correct record:

DoCmd.OpenForm "Popup", , ,"[EstadiaID] = " & Me.EstadiaID

I have assumed that EstadiaID is a number...

hth,
Jack
 
Code

I would apreciate if when anwser placed
you could explain what the code does, because i'm not familiarized with it.

where do i place the code above.
and does it triguer when i click the checkboxes in the form?


thanks for helping

Smith:rolleyes:
 
I have looked at the picture of your form and you do not have your table normalized. You should not have the memo fields in the table but in a related table. I would suggest that you normalize your tables before you go any further or you will have a lot of difficulty later on when you try to gather information from your database. You will find a simple tutorial on normalization here.

hth,
Jack
 
To Jack Cowley

I thougth in normalizing the estadias table

in this table i had tis field that is suposed to be; example:

"descontos" - yes or no field and description to the field thence memo field.

and as this field i have others like "Vauchers"; "Restaurant" and "bar"

do you sugest to build tables for each one of them.

I kind of thought droping the yes/no field and place subform separator for each field of memo. because one assumes that if you have notes on them, these have been checked yes.

CONCERNING OTHER TABLES DO YOU THINK THEY NEED INTERVENTION ON NORMALIZING THEM?

thanks a million for very usefull link.

greatings from portugal

Agent Smith
 
Last edited:
new structure

her is a sceme of the relations between tables after optimizing the estadias table.

can you tell if anything is wrong with this,
and give-me hints on how to improve it.
 

Attachments

  • estrutura1.jpg
    estrutura1.jpg
    69.1 KB · Views: 131
Tab into any field an press Ctrl+Z the built in zoom box will open, not sure if it's what your looking for though
 

Users who are viewing this thread

Back
Top Bottom