Displaying multiple lines

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that connects several tables together. This is a medical
project and the tables that I am interested in are the name, history and
medicine. The name prime key is in the history table. The history prime key
is in the medicine table. The name prime key is not in the medicine table.
When the form comes up, all the information is there pertaining to the 1st
name. In the medicine field, only 1 element appears. I would like to have
the ability to have the first 5 or so medicines that have been provided this
patient at the last visit. How can I do that?

Also, at the moment, when on the first record of the name table it has that
there are 3 records, and there is only 1 record in the name table. There are
3 records in the medicine table. When I go to the next record of the 'name'
table, the next record of the medicine table appears. I need for that to
stop too.

Any suggestions?
 
Tables are "connected" by relationships, not by forms. To use several tables
together you would use a query. If the relationships have been established
(Tools > Relationships) between the key fields you have described you could
build a form based on each table. Set the default view of frmMedicine (the
form based on the Medicine table or query) to Continuous. In form design
view drag the icon for frmMedicine onto frmHistory. Next, drag the icon for
frmHistory onto frmName. The first Name record will be associated with all
History records that contain the foreign key value that matches the primary
key value in the Name record.
 
Bruce,

Thank you for your reply. I think what you are describing is a 'subform',
and although I JUST tried that, I like your way better. I will try it that
way.

Thank you for your information. It is really helpful to know these
shortcuts and just basically to know that you and others are so willing to
share.

Again, thank you.

Craig
 
Bruce,

Ok, I tried it your way and I could not get it to work for some reason. The
records for the History table were not changing as the rest of the form was
retrieving the next record. Since the History record did not change, the
medicine record did not change. The medicin record still only showed 1
record at a time, vs the several that were there for the history record.

So, I now have the original way, with the main query bringing back the
records from all the tables and the medicine table is showed within a
subform. I have the entire form working and bringing up the data fine.
There are several things that I don't know how to correct yet, but I am still
working on it. However, I am still only getting (displaying) 1 record at a
time from the medicine table. How do I get, say 4 lines to be displayed at
one time with a scroll bar on the side if there are more than 4 elements to
display?

Thanks again for your fast reply.
 
To the second part, open the subform in design view and set the default view
to Continuous Form. For the part about it not working, it should if I
understand you correctly. If you click Tools > Relationships, what do you
see?
 
Bruce,

Again, thank you for your reply.

The default for the subform is contiuous form. I do agree that it 'should'
work, however, it is not, hence this post. I have tried changing the the
field in the subform to other types - like list box. As a list box all the
records in the medicine table show up. I posted a question on how to match
up, or link, or tie two fields together and that was apparently done
correctly - through a link on the data page.
As far as the relationships go, there is a diagram there - it has all the
tables that are used and then there are lines connecting certain tables.
Basically it is like an ERD diagram - showing how all the tables are
connected, through what keys, etc. That all looks correct- the Name table
primary key is in the tables that needed is as the foreign key and the
medicine table has the history prime key.

I must be doing something so simple wrong, otherwise it would be very easy
to spot.

Thank you for your help.

Craig
 
Back
Top