Newbie Help

M

manish.amina

Hi,
I had worked with oracle forms a long time back, but I am a newbie when

it comes to creating forms in Microsoft Access. I am trying to create a

master-detail form. My detail records have an part_ID field, the
description of which is stored in the parts master. How do I display
the description along with the detail record.

Also if I update the part_id here, how do I ensure that the description

also changes as soon as I enter the new part_id?


I am really going nuts here. Any help would be most appreciated.


Regards
Manish
 
J

John Vinson

Hi,
I had worked with oracle forms a long time back, but I am a newbie when

it comes to creating forms in Microsoft Access. I am trying to create a
master-detail form. My detail records have an part_ID field, the
description of which is stored in the parts master. How do I display
the description along with the detail record.

Also if I update the part_id here, how do I ensure that the description
also changes as soon as I enter the new part_id?


I am really going nuts here. Any help would be most appreciated.

What is the structure of your tables? tablenames and key fields? How
are they related

And what is the structure of your form?

Normally you would use a Combo Box on the Detail subform, storing the
Part_ID but having the Description as the first visible field. See the
Northwind sample database Order form for an example.

John W. Vinson[MVP]
 
M

manish.amina

Actually I was using the parts table as an analogy. I have 4 tables.
Their structures are as under
Analyst master
Analyst firm, first name, last name, address

Analyst sessions
Analyst firm, first name, last name, session ID, practice ID

Session Master
Session ID, session start time, session end time

Practice Master
Practice ID, Practice description

Analyst master -> analyst session (one-to-many). Each analyst can have
multiple sessions with multiple practices.
I tried to create a master-detail form using sub-forms. In the detail
form I have data from "analyst sessions" and have session ID & practice
ID displayed on each row. However, I do not know how to fetch the
descriptions from their respective masters

Any help would be appreciated.
 
J

John Vinson

Actually I was using the parts table as an analogy. I have 4 tables.
Their structures are as under
Analyst master
Analyst firm, first name, last name, address

Analyst sessions
Analyst firm, first name, last name, session ID, practice ID

Session Master
Session ID, session start time, session end time

Practice Master
Practice ID, Practice description

Analyst master -> analyst session (one-to-many). Each analyst can have
multiple sessions with multiple practices.

But are the First Name, Analyst Firm, Last Name field properly
attributes of a Session? or of an Analyst Master? That is: might you
have an Analyst Master record related to an Analyst Session record,
but have the names different in the two tables?

If not - then the name fields are redundant. Better would be to have
an artificial key (AnalystID, maybe an autonumber) in the Analyst
Master table, and a foreign key AnalystID (long integer if you use an
Autonumber) in the Analyst Sessions table.
I tried to create a master-detail form using sub-forms. In the detail
form I have data from "analyst sessions" and have session ID & practice
ID displayed on each row. However, I do not know how to fetch the
descriptions from their respective masters

Again the simplest way is just to use a Combo Box on the subform. If
you have a Combo with the Practice Master table as its Row Source, the
PracticeID as its Control Source, and the column widths property set
so that the PracticeID is of zero width and the Practice Description
is the only visible field, then the user will see the description; the
computer will see the ID; and they'll both be happy. It's easiest to
do this if you use a Continuous Form (rather than the wizard-provided
datasheet) as the default view of the subform.

If for some reason you don't want to do so, you can still display the
description; include the description in the combo (with zero width in
the ColumnWidths if you don't want to see it there at all), and put a
textbox on the subform with a control source

=comboboxname.Column(n)

using the name of the combo box, and using n as the *ZERO BASED* index
of the description field (i.e. if it's the second field in the combo's
rowsource use (1).)

John W. Vinson[MVP]
 
M

manish.amina

Thanks a lot man. It's too late on the east coast to try it out right
now. My mind is fried. Will try it out tomorrow morning
 
M

manish.amina

Thanks a lot man. It's too late on the east coast to try it out right
now. My mind is fried. Will try it out tomorrow morning
 

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