Tip:
Highlight text to annotate it
X
opening back up
our form navigator we see we've got
our main form and all the controls below it if I right click
on main form - bring up the properties
on the general tab
we see the name main form the events
we have nothing in there The data tab is the one we're most interested in
we've got the content type of table our content
is the table employees and we've got that sorted by
last name ascending then first name descending I'm going to
save and close this form and now I'm going to open up
the form we just created with the subform in edit mode I'm going to open
up
our form navigator and here we see
we've got a main form and the controls underneath one of them is called subform
let's look at the main form first and see if anything's changed
I'm going to right click and open the properties we see the General tab
has got the name main form no events the data tab has
got a content type table content - employees
and this one is not sorted at all if I click
on the subform we've get a little plus sign here
and we've got something called
subform grid so this is our control
under the subform if I go back to the subform
under our General tab we get the name
subform we don't have any events
looking back on our data tab We've got a
content-type: table this content is the employee phone number table
then we come down a little further
we see something that's called link master fields
link slave fields they are both set to employee ID
we know that employee ID is the field that we have to connect
our employees table and employees phone number table this information
will help us when we set up our sub form on our other form
let's go back into that we don't want to save any changes
I'm going to open this backup in edit mode
I want to open up the form navigator
I'm going to move thjis over to the right a little bit
Under the mainform we want to add a new form
so i'm going to right click on mainform
under new I want "Form"
It is adding it down here at the bottom I'm going to
right click and open up the properties
under general
instead a form we're going to call this
subform_Emp-Phn
events we don't have any events
now welcome back to data we want this...
to have a content type of table we want
the content to be the employee phone number table
then down under the
slave and master fields if we click this down arrow
we don't see anything if I click my
dialogue dot dot dot box it opens up
the link fields dialogue now we see the two tables
our employees table and our employees phone number table
we know that we want to link up employee-ID
to employee-ID I'm going to click OK
and there we see that they are in
the link and fields I'm going to
close this... We're not done yet...
we still need to add in a control on to our new
subform right now we just have an
empty subform I'm clicking on
my control - subform employee phone just to make sure that, that one is the one
that is selected
and we went to add a control out to it I"m going out over to our controls
and I want to click on this more controls
in this toolbar very last control
is a control called table control
table control is basically the same as datasheet control which looks like a
spreadsheet
they are all basically the same thing I'm going to click on this
I'm going to come down to where I want my upper left hand corner - I'm going to
left click and go over to where I want my lower right hand corner
and release the button this opens up
a little dialogue box and asks me what fields to I want to add from my employee
phone
to my control table or datasheet
I want them all to go in so I'm going to click the double arrow button
and finish
I'm going to stretch out the notes a little longer
and maybe the description
and I'm going to close my form navigator
as well as my more controls let's go in to
our design mode on/off
here we see all the data that we want to see going to the next record
previous record and if we use our form controls
we are going to the forward... previous...
when we click into our sub form
using our form controls forward and next
that works for inside the subform but when we use
our buttons that we placed and to our form
these buttons that we placed on to the form only work for the employee table
sense we have the employee-ID on our main form we really don't need the employee-ID
in our sub form
so I'm going to go back into design mode
and right click and delete this field
now we have a little more room to stretch out the notes field
I'm going to save this
close it
rename this from form employees
to odb36-
Employees-Add-Subform
and seve our database
all all cool all
all