Hi all,
Looking for help with displaying unrelated table fields on a form. My 3 tables are: PatientT, LocationT, and DoctorT. PatientT is controlled with form PatientF for new patient entry; PatientF has a lookup column field (LocationLookup) which prompts the user to pick from an exhaustive list of location names from LocationT. LocationT and DoctorT are related on a one to many basis via an autonumber field from LocationT.
I would like to make it so that when the user selects a location from the LocationLookup field on PatientF, certain information will populate from LocationT (address, phone number, etc.).
The expression I've come up with (using expression builder) to populate the address field from LocationT onto PatientF is:
=DLookUp([LocationT]![Address],[LocationT],([PatientT]![LocationLookup]=[LocationT]![Location]))
I'm not sure if the expression is right, since I don't know how to now add the field to the form. Can anyone advise?
Also, not sure if it's worth noting or not but PatientT and LocationT are not related. I'm not sure if they need to be since PatientF pulls location information directly from LocationT via the lookup column field.
Once I can populate all of the dlookup fields I'm looking for from LocationT, I would then like to add another field which will display the various doctors which relate to a given location from DoctorT. One location may have 4 doctors, for example. Ideally, I would like the user to select a location and then choose from a filtered list of only the doctors who operate out of the selected location.
I realize that this is sort of convoluted so please let me know if I'm not explaining this well. Any help is greatly appreciated.
Access 2016, Windows 10