Ask Your Question

LibreOffice Base get data from another table [closed]

asked 2017-10-19 03:39:54 +0100

Sebastian Ng gravatar image

updated 2017-10-19 03:49:20 +0100

I have few tables, 3 of them is tblPt, tblPtlog and tblDrs,

tblPt contains patient general info eg dob, address, phone no., etc, PtName is primary

tblDrs contains doctors' name, doctors' specialty, clinic, etc, DrName is Primary

and tblPtlog contains day of patient visiting, which doctor they visiting and doctor's specialty, etc, ID is Primary

in tblPtlog, doctors name are get from tblDrs and present as a drop down list,

is it possible that, after I select doctor from drop down list, it will automatic change the doctor specialty relatively? and how?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-10-18 14:20:36.178423


Hello @Sebastian Ng Why would you change the specialty of a doctors record just because a patient visit is recorded? Maybe you are just not specifying what result you are looking for.

Ratslinger gravatar imageRatslinger ( 2017-10-19 03:49:24 +0100 )edit

The answer is yes, but you will need to study-up on how databases, such as Base are designed and work. Do an internet search on the concept of Normalization. Normalization is the process of designing your database.

PS: I hope that your primary keys are auto-numbered integers. I could not tell from your narrative.

Steve R. gravatar imageSteve R. ( 2017-10-19 04:13:25 +0100 )edit

1 Answer

Sort by » oldest newest most voted

answered 2017-10-19 04:55:16 +0100

Ratslinger gravatar image

Hello @Sebastian Ng,

From what you present, as @Steve R. stated in his comment (Thank you, made me look again at the question), your structure is not right. In tblPtlog, you can display the Doctor name but you should store a link back to the tblDrs record. Now the doctor's specialty field is not needed in the tblPtlog record but can be accessed with the link to the doctors record when needed.

In my answer on this post, you can find a sample odb with linking records. There, all Sales items are linked back to a Receipt. The sales table also contains a drop down for selecting Products.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-10-19 03:39:54 +0100

Seen: 451 times

Last updated: Oct 19 '17