Use one form to update different tables

R

Robbert

First of all: What i am doing is regarded as bad database design. I am
creating different tables with exactly the same structure, a normalized
situation with just one patients table would be preferred. However the data
in question is very privacy sensitive and needs to be fysically seperated
from the other data.
In this case there is a table with patients for every doctor. Now i need a
way to use one form with a different source table depending on the doctor
selected.

Can anyone help me do this?
 
D

Dennis

In the On Load event of your form you can set the record source
Me.RecordSource = "Table you wish to use"

How you get the "Table you wish to use" is up to you. A combo box on a Menu
form maybe
Me.Recordsource = [Forms]![Menu]![ComboBoxName]
 
K

Klatuu

Sorry, Robbert, but you assumption the data is any more secure by putting it
in different tables is incorrect. There are other ways to accomplish this.
The correct way would, as you say, to have one patients table with a field
identifying which doctor the patient belongs to. Then it is a matter of
which user has access to which doctor's information. That can be controlled
with your own security method. This is not at all uncommon.

Yes, you can change the row source of a form either as it is opened or while
it is opened. That depends on how your system operates, but what, really, is
the differenece between chaning a row source and filtering a query by doctor?

Don't mean to beat you up, I am only trying to help, but when you think you
have a reason to violate good database normalization rules, you are always
wrong.
 
R

Robbert

No worries Klatuu, I agree with you and don't feel offended at all.
Separation of the tables is a requirement specified by my client. I am in
favour of normalization and will take this up with my client. I tried to
persuade her earlier but will try again.

Dennis thanks for the reply, if needed i now know how to change the record
source.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top