By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,124 Members | 2,027 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,124 IT Pros & Developers. It's quick & easy.

form select from 3 tables...insert only 1 talbe??

P: 3
Hi All

I am not a developer, but am trying to put together a small Access program for tracking patients in a clinic.

Here is where I HELP.

Form 1
I have created a form that shows patient info from 3 different tables (name, SSN, DOB, all episodes, and treatment for selected patient) my primary Key being PatientID and foreign key Epidsode ID and treatment ID from the 3rd table.

I am trying to create a way for user to enter any new or subsequent admissions for patient selected in form 1. I need the new record to be added to the episode table only without having the entered episode ID?

Any help/suggestion you can provide is greatly appreciated.


Thanks vern
Nov 19 '06 #1
Share this Question
Share on Google+
3 Replies


100+
P: 1,646
Hi All

I am not a developer, but am trying to put together a small Access program for tracking patients in a clinic.

Here is where I HELP.

Form 1
I have created a form that shows patient info from 3 different tables (name, SSN, DOB, all episodes, and treatment for selected patient) my primary Key being PatientID and foreign key Epidsode ID and treatment ID from the 3rd table.

I am trying to create a way for user to enter any new or subsequent admissions for patient selected in form 1. I need the new record to be added to the episode table only without having the entered episode ID?

Any help/suggestion you can provide is greatly appreciated.


Thanks vern
Hi Vern
If this is a new episode entry you can use the lastupdated property of your recordset to retrieve the Episode ID after you add a new record. If there are more than one episode per patient, the foreign key should be the Patient ID in the Episode table.

If this is an update of an existing episode then you should be storing the Episode ID on a hidden label on the form
Nov 19 '06 #2

P: 3
Thanks for you help...

there are multiple episodes per patient...how can I trap the patientID for insert? when I'm inserting a new record from the form how could i know the patientID?
Nov 20 '06 #3

100+
P: 1,646
Thanks for you help...

there are multiple episodes per patient...how can I trap the patientID for insert? when I'm inserting a new record from the form how could i know the patientID?
That is part of the logic of the form.
If this is a form just to create a new episode record the user should have a way to select which patient it is for. Either by entering the id in a textbox (very prone to errors) or selecting it from a combobox populated from the table.
Nov 22 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.