Hello all,
I have been banging my head against a problem which seemed to me shouldn't have been a problem at all. Access seems to be of a different opinion however. Or i'm not doing it right
I have a form with a tabview control with 2 tabs. Each tab has a subform (sf_1 on tab1 and sf_2 on tab2) in it containing 2 cascading combo boxes cboDept and cboRoom. cboRoom shows a list of all rooms in the selected department. Each form is based on a different query on the same table.
The goal is to have each combo box on both forms display the same value. When i select a new dept and room on sf_1 it should instantly reflect this change in sf_2 and vice versa.
The weird thing about it is that it works the first time i do it, just after the main form has loaded. For example: I select the new dept & room in sf_1 and the changes are instantly reflected in sf_2 as i would expect. However, when i try it again, cboDept changes as it should but i simply cannot get cboRoom to requery on sf_2. It keeps displaying its old data but with a blank selection since the value from cboRooms on sf_1 isn't contained in its current selection set.
When i change the dept and the room, close the main form and open it again the changes have been saved correctly and both forms display the previously selected dept and room. It's really odd, especially since i'm not getting any error messages whatsoever.
Private Sub cboDept_AfterUpdate()
cboRooms.Requery 'to update the rooms after selecting a new dept
Forms!Frm_Tabs!sf_2.Requery 'to have the other form update cboRooms to have the correct list
End Sub
Private Sub cboRooms_AfterUpdate()
Forms!Frm_Tabs!sf_2.Requery 'to have the other form update cboRooms and display the correct value
End Sub
That was my first try, after that i've tried a bunch of different ways to get that comb box to update but to no avail.
I tried setting focus on the other form and then on the combo box and then requerying the combo box. No workie
I tried directly referencing the combo box and requerying like this:
Forms!Frm_Tabs!sf_2!cboRooms.Requery
But it just gave me an error that it didn't support this command.
I tried first refreshing the current form and then requerying the other form, I tried refreshing the current form, setting focus on the other form and then refreshing that form and then requerying that form. Then I tried the same thing but including requerying the combo box. Nothing worked
Is there something blaringly obvious that i'm missing here? I'm starting to think so.
Any help is appreciated
I have been banging my head against a problem which seemed to me shouldn't have been a problem at all. Access seems to be of a different opinion however. Or i'm not doing it right
I have a form with a tabview control with 2 tabs. Each tab has a subform (sf_1 on tab1 and sf_2 on tab2) in it containing 2 cascading combo boxes cboDept and cboRoom. cboRoom shows a list of all rooms in the selected department. Each form is based on a different query on the same table.
The goal is to have each combo box on both forms display the same value. When i select a new dept and room on sf_1 it should instantly reflect this change in sf_2 and vice versa.
The weird thing about it is that it works the first time i do it, just after the main form has loaded. For example: I select the new dept & room in sf_1 and the changes are instantly reflected in sf_2 as i would expect. However, when i try it again, cboDept changes as it should but i simply cannot get cboRoom to requery on sf_2. It keeps displaying its old data but with a blank selection since the value from cboRooms on sf_1 isn't contained in its current selection set.
When i change the dept and the room, close the main form and open it again the changes have been saved correctly and both forms display the previously selected dept and room. It's really odd, especially since i'm not getting any error messages whatsoever.
Private Sub cboDept_AfterUpdate()
cboRooms.Requery 'to update the rooms after selecting a new dept
Forms!Frm_Tabs!sf_2.Requery 'to have the other form update cboRooms to have the correct list
End Sub
Private Sub cboRooms_AfterUpdate()
Forms!Frm_Tabs!sf_2.Requery 'to have the other form update cboRooms and display the correct value
End Sub
That was my first try, after that i've tried a bunch of different ways to get that comb box to update but to no avail.
I tried setting focus on the other form and then on the combo box and then requerying the combo box. No workie
I tried directly referencing the combo box and requerying like this:
Forms!Frm_Tabs!sf_2!cboRooms.Requery
But it just gave me an error that it didn't support this command.
I tried first refreshing the current form and then requerying the other form, I tried refreshing the current form, setting focus on the other form and then refreshing that form and then requerying that form. Then I tried the same thing but including requerying the combo box. Nothing worked
Is there something blaringly obvious that i'm missing here? I'm starting to think so.
Any help is appreciated