Help!! Entry Forms for Parent-Child Tables.

Hey there.

CHeck out the form called "test" in this DB. It ALMOST does what I want, that is you can see all of the child records as you cycle through the parent records.

What I want to do is have a combo box for Patient K Number where a user can select a patient that way. It doesnt seem to work, only the PK seems to.

My long term plan is to have either a cascading filter system where users can search by unit & isolation type etc., or simple several search forms for different criteria that can be accessed from the switchboard.

BUT FIRST, I need to get over this seemingly easy, but very frustrating hurdle.

-Z
 

Attachments

Have you read any of the things I suggested? They might help to illuminate the solution for you. I don't want to do your work for you. Try using the combo box wizard, see if that can shed some light on things for you. If you do these things and are still not able to figure out, then I'll help you further.
 
I don't want to make you do the work, and believe me I've tried all of your suggestions and several more. It doesn't seem to matter what I try, I just don't understand the reasons why I can't grasp this stuff. Nothing I try works, I can't even figure out how to do what I described in my previous post. I've spent about 40 hours on this so far and I feel like its about 10 minutes of work.

Have a look at my recent attachment, what is the reason that I cannot get the combo box "PatientKNum" to populate the subform ?

-Z
 
You need to have a seperate combo box that does the lookup - dont bind it to patient no as you have
 

Attachments

Im sorry Dcb, that new combo box doesnt seem to do anything. Do I need a button or something? was it just a hint ? I dont get it :( ....
 
Im sorry Dcb, that new combo box doesnt seem to do anything. Do I need a button or something? was it just a hint ? I dont get it :( ....

It doesnt do anything? Are you using 2007 with security? - If so enable as the combo box has code - just tested my side again
 
Yea actually the file was made at work on MS 2003 I think. Im at home now using MS 2007. Is that a problem ?

Enable what?
 
nope not a issue just make sure that the file is in a location that you have "trusted" in your "trust center" - Otherwise nothing will work! It turns off the code in the db's until you have either told it to enable (options button may or may not show on top) or have it in a trusted location
 
I wonder if one of the reasons it is not working is that, at least in the example, the K number is not unique to the patient?
 
If your goal is to add a new case to the patient using the frmNewCaseExistingPatien form a couple of things.

1) In your subform shell, your master link should be pkPatentID, your child link should be fkPatientID.

2) Make you sample data K number unique to the patient as you say that this is what it should be, other wise dupicates will occur. If you want it to duplicate then you need to build a query to take care of that or....use select distinct somehow.

3) Use the combo box wizard on your main form, and select "Find record on my form based on selection..." Use the patient ID and the K number for the combo box, then have it sort by the K number, this will hide the patient ID.

4) to test, add Patient ID to your main form, and add fkPatient ID to your subform.
 
Last edited:
Thanks for the help. I dont feel quite so lost now.

I have a question, in the subform that displays all of the child records, the fields included are the ID numbers from the tblCase table and not the actual names from the other tables.

I plan on the view for the subform being "single form" for editing purposes. Right user can't really edit child records since they dont know the codes for isolation types, and unit names etc. How can I make it easy for users to edit a child record? I know I need to add in new combo boxes and hide the ID code ones, but I can't get them to edit the child record.

-Z
 
Use the combo box wizard. It should guid you. select your tbl id and the name when picking what fields to use.
 
Ok, I think that I am pretty set on how to lead users through the data entry and editting portion of my database.

Start Page - A List of all cases that have "IsNull" for an EndDate. I have a listbox that runs off of a query that will display all of these records. So the user will first check this table, and double click on the record they wish to edit (I havent started this part yet, but I have a good example to work off of). If the patient they are looking for is not in this listbox, they will then click a button taking them to the next form.

Second Page - This is the part I'm currently having problems with. This form will allow to user to look up ALL patients by K# and allow them to enter a new child record for them. I do not know how to set up data entry for this subform. All of the fields are ID fields, which are numeric keys for the Unit table, infection table etc. I'd love some help getting these set up correctly.

Last Form - If the user doesnt find their patient in the 2nd form, they click a button to take them to a blank form where they enter both parent and child record information, creating a new record in the parent table. (Thanks to your help this form works perfectly.


If anyone would care to help with the 1st or 2nd forms, I'd be greatly appreciative. And I thank everyone for their help so far !

-Z
 

Attachments

Second Page - This is the part I'm currently having problems with. This form will allow to user to look up ALL patients by K# and allow them to enter a new child record for them. I do not know how to set up data entry for this subform. All of the fields are ID fields, which are numeric keys for the Unit table, infection table etc. I'd love some help getting these set up correctly.

You would use combo boxes on your subform for this use the wizard, it will guide your right through the process. when selecting the table and fields for the lookup, include whatever it is you want your users to see, then it will automatically hide the id key.
 
Last edited:
Last Form - If the user doesnt find their patient in the 2nd form, they click a button to take them to a blank form where they enter both parent and child record information, creating a new record in the parent table. (Thanks to your help this form works perfectly.

Just add a button to your current (Them main not the sub) form, follow the wizard for setting it up to go to new record? Then you don't need a new form, just the same one.

You have to click, "Allow Editions" to yes, also just a thought. If you want to force them to click the button to make the edits instead of allowing them to scroll through to a new record. Set up the button to add new, leave your form set to Allow Editions "no". Then go into the code behind the button, and add a line underneath the error handler thing and before the add new record portion and add the following.

Me.AllowEditions = True.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom