Updating combo box values

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with (2) combo boxes. The values in Combo Box "SubType" are
based on the value I selected in Combo Box "Type". If I select Type 1 in
"Type" then the choice in "SubType" should be 1a, 1b, etc..., if "A" is Type
2 then "B" should be 2a, 2b, etc....

On the Row Source property for "SubType" I used the query builder and set it
to Forms!Inventory]![Type] . This only works when I first open the form. If
I select Type 1 in "Type" then 1a, 1b, etc.. is displayed in "SubType" but if
I change (or enter a new record) "Type" to Type 2 then 1a, 1b is still
displaying in "SubType". I tried using the OnChange event but that didn't
work either.

Is there an quick and easy way to do this.

Thanks,
Millertime
 
On the Row Source property for "SubType" I used the query builder and set it
to Forms!Inventory]![Type] . This only works when I first open the form. If
I select Type 1 in "Type" then 1a, 1b, etc.. is displayed in "SubType" but if
I change (or enter a new record) "Type" to Type 2 then 1a, 1b is still
displaying in "SubType". I tried using the OnChange event but that didn't
work either.

Is there an quick and easy way to do this.

Use the AfterUpdate event of the Type combo box:

Private Sub Type_AfterUpdate()
Me!SubType.Requery
End Sub

John W. Vinson[MVP]
 
Thanks for the help. This solved the problem I was having.

Millertime

John Vinson said:
On the Row Source property for "SubType" I used the query builder and set it
to Forms!Inventory]![Type] . This only works when I first open the form. If
I select Type 1 in "Type" then 1a, 1b, etc.. is displayed in "SubType" but if
I change (or enter a new record) "Type" to Type 2 then 1a, 1b is still
displaying in "SubType". I tried using the OnChange event but that didn't
work either.

Is there an quick and easy way to do this.

Use the AfterUpdate event of the Type combo box:

Private Sub Type_AfterUpdate()
Me!SubType.Requery
End Sub

John W. Vinson[MVP]
 
Thank you as well. I searched through about half a dozen other posts, and
this was the only one that ended up working.
Thanks

Aaron


Millertime said:
Thanks for the help. This solved the problem I was having.

Millertime

John Vinson said:
On the Row Source property for "SubType" I used the query builder and set it
to Forms!Inventory]![Type] . This only works when I first open the form. If
I select Type 1 in "Type" then 1a, 1b, etc.. is displayed in "SubType" but if
I change (or enter a new record) "Type" to Type 2 then 1a, 1b is still
displaying in "SubType". I tried using the OnChange event but that didn't
work either.

Is there an quick and easy way to do this.

Use the AfterUpdate event of the Type combo box:

Private Sub Type_AfterUpdate()
Me!SubType.Requery
End Sub

John W. Vinson[MVP]
 
Back
Top