Thread: Auto Fill
View Single Post
  #5  
Old March 2nd, 2010, 08:05 PM posted to microsoft.public.access.gettingstarted
Amy
external usenet poster
 
Posts: 412
Default Auto Fill

Thanks for your help. But is there any way you could dumb it down for me?
I am unfamiliar with entering any kind of code. Your help is SOOO much
appreciated!!!

"KenSheridan via AccessMonster.com" wrote:

Your form should be based on a query on the CoursesTaken table which
references a combo box of employees on the same form. I'll come back to the
combo box later, but the query would be:

SELECT *
FROM [CoursesTaken]
WHERE [EmployeeID] = Form![cboEmployee];

Make the form a continuous form. If you use the form wizard to create it
select 'tabular' as the layout. You only need controls in the form for the
CourseID and other columns like the date taken etc, not for the EmployeeID.

In the form make the control bound to the CourseID column a combo box set up
like this:

ControlSource: CourseID

RowSource: SELECT [CourseID], [CourseName]FROM [Courses] ORDER BY
[CourseName];

BoundColumn: 1
ColumnCount: 2
ColumnWidths: 0cm;8cm

If your units of measurement are imperial rather than metric Access will
automatically convert them. The important thing is that the first dimension
is zero to hide the first column and that the second is at least as wide as
the combo box.

In the form's header add a combo box and set it up like this:

Name: cboEmployee

ControlSource: Leave this blank

RowSource: SELECT [EmployeeID], [FirstName] & " " & [LastName] FROM
[Employees] ORDER BY [LastName], [FirstName];

BoundColumn: 1
ColumnCount: 2
ColumnWidths: 0cm;8cm

In the AfterUpdate event procedure of this combo box put:

Me.Requery

This requeries the form so it shows only the courses for the selected
employee. If you are unfamiliar with entering code in event procedures you
do this by selecting the cboEmployee combo box in form design view and
opening its properties sheet if its not already open. Then select the After
Update event property in the properties sheet. Click on the 'build' button;
that's the one on the right with 3 dots. Select 'Code Builder' in the
dialogue, and click OK. The VBA window will open at the event procedure with
the first and last lines already in place. Enter the line of code between
these two existing lines.

When the form opens it will not show any records. Select an employee from
the combo box and it should then show any courses taken by the employee.
You can add a new attendance at a course for the current employee by adding a
new record in the blank row below the existing course attendance records
simply by selecting a course in the combo box and entering the date taken etc
as appropriate.

Ken Sheridan
Stafford, England

Amy wrote:
Thank you for helping! Here is my next problem
I have created the tables to store all the information. My question now, is
how do I get it all to connect? I have created a query and a form but I don't
think I did it right. I would like to be able to type in the employee's name
and have all the training they have completed show up.

If I type information such as employee name and course into a form, how is
the data stored? Is it saved somewhere?

I'm trying to enter employee training information. I want to be able to type
in an identifier (last name or employee number) and it will bring up

[quoted text clipped - 33 lines]
MVP Allen Browne's tutorials:
http://allenbrowne.com/links.html#Tutorials


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...arted/201003/1

.