Combo Box Problems

yanos

Registered User.
Local time
Today, 21:19
Joined
Mar 25, 2008
Messages
11
Hi all.
I am a relative beginner using Access and I am still using 2003 I am trying to develop a database to store student details, module details and area of expertise of lecturers
The tables are Students,ModuleName, Instructors and Expertise. I have a students form with a module subform. In this subform I am entering the following data, Module Name; Area of Expertise and Lecturer. The idea being to select the area of expertise (cboExpertise) and this filters the lecturers listed in the following combo box (cboInstructor).
I have looked at and tried to use the various examples but I am doing something stupid.

Query in RowSource of cboInstructors
SELECT [Expertise].[Expertise], [Expertise].[AreasID] FROM Expertise;
Query in RowSource of cboExpertise
SELECT [Instructors].[ InstructorsID], [Instructors].[AreasID], [Instructors].[ Instructor] FROM Instructors;

Private Sub cboInstructors_AfterUpdate()
Dim sInstructorSource As String
sInstructorSource = "SELECT [Instructors].[InstructorsID], [Instructors].[AreasID], [Instructors].[Instructor] " & _
"FROM Instructors " & _
"WHERE [AreasID] = " & Me.cboInstructors.Value
Me.cboExpertise.RowSource = sInstructorSource
Me.cboExpertise.Requery
End Sub

Help please:eek:
 
refferencing sub form controls

i believe that if your are referencing a control on a subform you cant use "me.control". try refferencing the control like this:
Forms("MainForm")("SubForm").Form.Controls.("SubFormControlName").
 
hi

Yep I got it sorted Thanks

iain:cool:
 

Users who are viewing this thread

Back
Top Bottom