Subform/Combo Box Woes

Tracer

New member
Local time
Today, 14:06
Joined
Dec 20, 2001
Messages
5
I am trying to set up a database of patient information. My main form is the patient demographics. My subform is a list of their current doctors (datasheet view). I have created the doctor subform using two separate tables, and linking them to the main form with Patient ID. (Child and Master are linked using Patient ID). I have managed to get the subform to work using a combo box so I can choose using surnames, from a list of 2600 doctors and once I choose the doctor their address etc. shows up. The record in this subform also shows patient ID correctly. My problem is that as soon as I go to the next patient record and then return to look at the doctor's that I just entered in my subform, they are no longer there. i.e. I enter the doctors in the subform, but they will not stay attached to the individual patient record. Hope this makes sense. It is driving me crazy. I am using Access 2K.
HELP!
 
When you place a subform on a main form you have to set two values on the subform field. These are Link Child Fields and Link Master Fields. If you set Link Child Fields to PatientID and Link Master Fields to which ever field in the Patient table has their unique number (probably Patient ID), the subform will automatically assign the new record in the subform to the patient displayed in the main form.

HTH
SteveA
smile.gif
 
I have already done that Steve? Any other suggestions?
 
If you look at the database tables, are the records being saved correctly?

Cheers,
SteveA
 
Hi Steve and Pat. Thanks for our reply. Pat, I am not sure what 'add' mode is?? With regards to the tables. I checked and it appears that the diagnosis' subform information is saving in the query table, just not showing in the form view (I enter it and go to another record , and come back and it is not showing). the doctor subform on the other hand, does not appear to be saving in a table anywhere. Could this have something to do with the fact that the doctor subform was created using two separate tables (Dr. table and ref Dr. table), instead of creating the subform using a query of the necessary info from thoses two tables? i.e. diagnosis subform saving in a table, but once entered, not showing in form view. Doctor subform on the other hand doesn't seem to be saving in a table, and once entered, not showing in the form view either? I have double checked the master and child links, and they are all linked with Patient ID. Hope this makes sense. Thanks.

Tracy
 
I think Pat means in 'Add mode' that you have the Allow Additions property set to Yes so you can add new records. If you are adding new records and they are being saved to the table then you should be OK.

The form based on two tables has to be based on a query that is based on the two tables. And the reason you may not be seeing the data after you enter it is because the form needs to be 'requeried' so it 'sees' the latest addition(s). Search Help for Requery as well as Refresh to find out how to refresh your forms.
 
Thanks so much for the suggestions. I will give them a try and get back to you.
smile.gif


Tracy
 

Users who are viewing this thread

Back
Top Bottom