Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RelationShip one-to-one

Status
Not open for further replies.

drikoudis

Programmer
Nov 1, 2003
53
GR
Hello, i want someone to help me. My problem.... I have a Table [PATIENTS] for the patients, another for the visit, i said [VISIT]. They have one-to-many relationship. A third table [SOMETHING] have relationship one-to-one with the [VISIT] table. Now my problem is when i try to make a form with Tabs (first tab:pATIENT, second tab:VISIT and third tab:SOMETHING)i appoint master detail the [PATIENT] table, everything work OK accept that i cant post the ID from [VISIT] table to [SOMETHING] table in field VISIT_ID. Can anyone help me?

Sorry for my English, if you can not understand something send me a mail. Thank, John.
 
Hi John drikoudis

In the process of trying to understand I guess my first thought is ponder why you need so many one-to-one relationships.
[tt]
PATIENTS VISIT SOMETHING

PatientID -> PatientID
VisitID -> VisitID
[/tt]

The short answer to problem / question is that the PatientID is avaialable on the main form. Your SOMETHING want to access the VisitID which is on VISIT subform.

Normally, you usually include only tables / data that directly relate the main form. You met this criteria but in and indirect route.

You can probably directly reference the subform to achieve this...

[tt]
[form]![YourFormOrSubFormName]![YourField]
[/tt]
Specifically,[tt]
[form]![VISIT]![VISIT_ID][/tt]

Hope this gets you one your way.

By-the-way, it is unusual to have one-to-one relationships except for very special cases such as confidentiality - a public table and a private table.

Although there are other reasons for using one-to-one, are you sure this is the correct design?


Richard
 
How are ya drikoudis . . . . .

Have a look at ther following:

[blue]Normalizing Tables[/blue]

[blue]Table Relationships[/blue]

Calvin.gif
See Ya! . . . . . .
 
Dear Richard and TheAceMan1 thanks very much for the help, it was useful.


John.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top