Hi Jordan
See if the form works by entering some data. Add some Attourneys to
TblAttourney just to get you started.
Can you add/edit the Practice Area details to the main form? When you have
done this, try using your combo (the one based on TblAttourney) to add new
records to the subform. Does this work? Does the subform filter to show only
the Attorneys which are in that Practice Area as you turn the main form from
1 page to the next?
Open the main form in Design View. Add a combo box. Because your main form
has a primary key and shows unique records, the wizard should present you
with the option to Find a Record on My Form...
Choose this option, Choose PracticeID and Practice. On the last 'page'
choose to 'Remember the Value for Later Use'
You will now be able to use the combo to turn to any page of your form to
see a list of attorneys in that Practice Area.
One more thing
Is 'ID' the name of the Primary key field of TblPracticeArea? Is it the only
PK field called ID? If you have allowed Access to call more than one field
ID then you will find this very confusing as your database continues and I'd
recommend changing that name to something short but explanatory eg PracID,
before you continue with your forms - its worth doing it at this stage even
if it means scrapping the form which you have created.
Evi
Jordan said:
Ok I did everything as instructed, as of now the subform shows ID, Attorney
ID, and a combo box. both the attorney id and combo box are drop down menu.
So whats next?
I really do appreciate this Im learning quite abit from you!
Sure, we'll do it with the tables first (you can change to a query later
on)#
First, open the Relationships window and drag AttorneyID FROM Attorney Table
and onto AttorneyID in Attorney Practice.
Choose to Enforce Referential Integrity
Drag PracticeID FROM Practice Areas and onto PracticeID in Attorney
Practice.
Again, enforce Referential Integrity.
You have now created a proper Relational Database.
Save and close the Relationships window
With your tables closed, click on Practice Areas Table to select it,
without opening it.
(I hope that colon is a typo, you don't want symbols in table or field
names - the ideal is to stick to shortish but descriptive names for both
with no symbols or spaces - its far easier for you when you start coding -
a good naming convention is call all Tables Tblxxx, all Forms Frmxxx etc.
Don't be concerned about what they look like in the database window - no-one
need ever see that)
Go to Insert, Form
Choose Autoform, Columnar (this gives you a single form based on Practice
Areas Table )
Save and open the form in Design View shrinking it enough so that you can
see it and the database window. Drag the Details area down so that it
becomes a bit taller.
Click on the Attorney Practice Table in the main database window, and,
without opening it, drag it onto the Main Database window.
The Wizard should kick in here and spot that the two forms have a common
key - PracticeID - and offer you the option ot create this link in a line of
text in a box, the relevant part of which usually disappears off the edge of
the box!!! (don't panic if the Wizard doesn't play ball, everything can be
done without the Wizard)
Give your newly created subform the same name as your sub
You now have a form with a linked subform, You won't see the Attourneys
yet, just AttourneyID
Save and close.
Type an entry into your Attorney Table, just to get you started
Open the new Subform in Design view.
On the Toolbox toolbar (or whatever monstrosity Acc2007 has, to replace it)
Click on Combo Box and then click on the Detail section of the Subform. The
wizard should kick in. Tell him that you want to base your combo on the
Attorney Table. Choose the fields AttorneyID and AttorneySurname for now.
The Wizard will hide the AttorneyID field which, although it won't be
visible in the combo, will be the 'Value' of the combo.
Choose to 'store the value' of the combo in AttorneyID
Save and open the form in normal view. Drag closed the fields you don't want
to see. Open your main form to see the results.
write back if you get stuck, stating which bit didn't work.
Evi