Desperate for help: How to base combo box on another combo box in 2007?

Did you try the sample I uploaded?

When you make a change to Combo OfficerNumber, you should see that the selection within Combo EDWNumber changes. Does this happen for you or are you expecting something else :confused:

Hi John,
I tried the sample that you uploaded and it works perfect for the first time, I mean the first record that I enter when I open the database, but then when I move to new record and choose another "OfficerNumber" the "EDWNumber" does't change from the previous record. I have to click on refresh button to make it work again.
 
I'm at work and currently don't have Access '07. So can't test my previous upload, but I thought I tested it pretty thoroughly :confused:

Any way I've made the same adjustments to the '03 version and tested them, and it works as advertised (for me at any rate), let me know what happens now.
 

Attachments

I'm at work and currently don't have Access '07. So can't test my previous upload, but I thought I tested it pretty thoroughly :confused:

Any way I've made the same adjustments to the '03 version and tested them, and it works as advertised (for me at any rate), let me know what happens now.


Hi John,

I'm sorry it's not working, the second list is not changing.
 
HeadBang.gif
 
Please describe step by step, what you are doing, and what is happening in response.

Also, and separately, describe step by step, what you think should be happening.
 
Try the following Code:

Code:
Private Sub Form_Current()
If Me.NewRecord Then
   Exit Sub
Else
   Me.EDWNumber.Requery
End If
End Sub

Private Sub OfficerNumber_AfterUpdate()
On Error Resume Next
   Me.Refresh
   Me.EDWNumber.Requery
End Sub
 
What you really needs to be a separate table for

Professional Licensing Officers

Project Details
Project Details School Officers

Project Reviews
Project Reviews Inspection Officers
Project Reviews School Officers

This way you can handle Multiple Reviews with different Inspection personnel and at times different School Officers, although they could be the same in a follow-up.

Simon
 
Please describe step by step, what you are doing, and what is happening in response.

Also, and separately, describe step by step, what you think should be happening.


Hi John,
Steps that I'm doing:
1. choose Officer Number from the first combo box
2. choose EDW Number from the second combo box (this step bring automatically to the form some related details which are linked to EDW Number)
3. Then I can fill normally all the other details in the form. (till this step everything is working fine)
4. click "new record"
5. choose another Officer Number
6. when trying to choose EDW Number the list that appears is still the same from the previous record. (I have to click "refresh" then the list works fine again) - (same problem also apply if I want to change the officer number when I'm still in the same record, the EDWNumber box does not change)

What should be happening:
steps from 1-5 same as above.
6. when I choose another officer number in new record or in the same record the EDW number should change accordingly without the need to hit "refresh button" every time.
 
Try the following Code:

Code:
Private Sub Form_Current()
If Me.NewRecord Then
   Exit Sub
Else
   Me.EDWNumber.Requery
End If
End Sub
 
Private Sub OfficerNumber_AfterUpdate()
On Error Resume Next
   Me.Refresh
   Me.EDWNumber.Requery
End Sub


Hi,
I tried it but nothing has changed. The problem is still hapenning.
Thanks any way.
 
The database with the following code is attached:

Code:
Private Sub Form_Current()
If Me.NewRecord Then
   Exit Sub
Else
   Me.EDWNumber.Requery
End If
End Sub

Private Sub OfficerNumber_AfterUpdate()
On Error Resume Next
   Me.Refresh
   Me.EDWNumber.Requery
End Sub

Try it out.

I have a Blog post on this subject; if you have the time; take a look at it:
Refresh Dependant Combobox Contents
 

Attachments

Last edited:
Hi John,
Steps that I'm doing:
1. choose Officer Number from the first combo box
2. choose EDW Number from the second combo box (this step bring automatically to the form some related details which are linked to EDW Number)
3. Then I can fill normally all the other details in the form. (till this step everything is working fine)
4. click "new record"
5. choose another Officer Number
6. when trying to choose EDW Number the list that appears is still the same from the previous record. (I have to click "refresh" then the list works fine again) - (same problem also apply if I want to change the officer number when I'm still in the same record, the EDWNumber box does not change)

What should be happening:
steps from 1-5 same as above.
6. when I choose another officer number in new record or in the same record the EDW number should change accordingly without the need to hit "refresh button" every time.

I'm sorry but I am unable to replicate this on my machine :confused: The DB works exactly as advertised on both my work and home PC's
 

Users who are viewing this thread

Back
Top Bottom