Thread: Auto Fill
View Single Post
  #6  
Old March 2nd, 2010, 11:21 PM posted to microsoft.public.access.gettingstarted
KenSheridan via AccessMonster.com
external usenet poster
 
Posts: 1,610
Default Auto Fill

I'll try, but to paraphrase Einstein, some things can be made as simple as
possible but no more so. I'm assuming you've created the tables just as John
described, that the Employees table has data, and that the Courses table has
been filled with course data.

1. First you need to create a query, so open the query designed; don't add
any tables and then switch to SQL view. In the SQL window paste in the
following in place of what's the

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

2. Save the query under a suitable name. If you try and open it now it will
prompt for a parameter value. Don't worry about that; its just because the
form and its combo box isn't yet created.

3. Create a continuous forms view form based on this query, which you can do
with the form wizard. Again if you try and open the form it will at this
stage prompt for a parameter value, but don't worry about that.

4. Open the form in design view. It will at this stage probably have a text
box as the control bound to the CourseID field. Chage this to a combo box
which you can do by right clicking on the text box and selecting ChangeTo ïƒ*
Combo Box from the short cut menu. Open the combo box's properties sheet if
its not already open and set its properties as I described in my last post.

5. With the form still open in design view add a cboEmployee combo box in
the form header. Set its properties as I described in my last post.

6. Finally add the line Me.Requery to the cboEmployee combo box's
AfdterUpdate event procedure in the way I described.

7. Save the form.

You should then be able to switch the form to form view and select an
employee from the combo box to see any courses they've been assigned to in
the CoursesTaken table, and add any course you wish to assign them to. If
you need to assign an employee to a course which is not yet in the Courses
table there is a way this can be done by typing the course name directly into
the CourseID combo box on the form, but that's something we can come back to
later once you've got the form working correctly otherwise.

Ken Sheridan
Stafford, England

Amy wrote:
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!!!

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

[quoted text clipped - 76 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