• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 443
  • Last Modified:

Cascading combo box not updating when new selection made in Access 2007

HI there, I know there are heaps of topics on Cascading combo boxes and I have followed each one carefully but cannot work out why I am having this problem.  

I have a form called frmEnquiry and it has two combo boxes:  Course and Topic.  When you select a value in Course, then it will show the Topics related to that course

The row source for Course is qryCourses and for Topic, is qryTopic
I have created two queries:

qryCourses - select CourseId, Course from Courses

qryTopic - select TopicId, CourseID, Topic from Topics
and in the criteria, I have typed [Forms]![frmEnquiry]![Course] (in the design view)

In the After_update property for Course, I have used Me.Topic.Requery and I have used the same for the Current property for the form.

When I view the form initially, the second combo box is displaying the correct values however if I change the value in the Course Combo box, it is not being passed through to the Topic Combo box so the Topic combo box is still showing the values from the first selection.

I have been over this several times but cannot work out why it is not working.

Any ideas would be much appreciated
0
lesleyag
Asked:
lesleyag
  • 2
1 Solution
 
lesleyagAuthor Commented:
One more thing I forgot to ask, how do you resize a form in Access 2007?  I want to display the form above as a small form on the main form but control its visibility so don't want to have a full-size form.
0
 
theplonkCommented:
Double check that your course combo box has it's "bound column" property set to the column index of the id field.
eg. your query might return columns
"CourseName", "CourseId"

The first column will become your combobox text, and if you set bound column 2 it will change the returned value of the combobox to reflect the value of the "CourseId" field.

The add "On Change" event to the course combobox, and add the code to run a requery on the topic combobox.
0
 
Jeffrey CoachmanCommented:
lesleyag,

As you know, you are only allowed one question per post.

Can this be a new question?:
"One more thing I forgot to ask, how do you resize a form in Access 2007?  I want to display the form above as a small form on the main form but control its visibility so don't want to have a full-size form.
...This is so you can get one answer to one question.

It also gives other experts a chance to help you out.

Thanks
;-)

JeffCoachman
0
 
lesleyagAuthor Commented:
sorry I clicked the button before I had typed this part but I will put it as another question
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now