LibreOffice Base get data from another table

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?

Hello @SebastianNg 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.

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.

Hello @SebastianNg,

From what you present, as @SteveR 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.