F
Frank Rudolph
I have a cascading sequence of events that I want to have happen in an
Access form.
When I select from the SELECT set of a combo box, called "code" I create a
new SELECT set for a "name" field that is a one element select set.
I did this by programming an onChange action that says:
Private Sub Code_AfterUpdate()
Name.RowSource = "NameType"
End Sub
'NameType" is a query that results in a single seletion that becomes the new
select set for the 'name' combo box, whose control source happens to be a
field called 'name'. This select set has only one element in it, which is
the new name corresponding to the 3-digit code entered in the code combo
box.
Selecting this new value of name in turn starts a cascade of other queries
that generates new select sets for several other fields.
The whole process works just fine if after changing the 'code' field, I then
pull down the select set (with only one element) for name and select it,
because the onChange action of 'name' triggers the queries for the dependent
fields.
But the requirement I'm trying to satisfy says that the name field should
automatically assume the value in its single element select set without me
having to pulldown and select.
I wonder if there isn't some VBA "magic" that I can put in the onChange
event subroutine Code_AfterUpdate() that forces the 'name' combo box to
assume the value of the only item in its select set.
You help would be GREATLY appreciated.
- Frank Rudolph
Access form.
When I select from the SELECT set of a combo box, called "code" I create a
new SELECT set for a "name" field that is a one element select set.
I did this by programming an onChange action that says:
Private Sub Code_AfterUpdate()
Name.RowSource = "NameType"
End Sub
'NameType" is a query that results in a single seletion that becomes the new
select set for the 'name' combo box, whose control source happens to be a
field called 'name'. This select set has only one element in it, which is
the new name corresponding to the 3-digit code entered in the code combo
box.
Selecting this new value of name in turn starts a cascade of other queries
that generates new select sets for several other fields.
The whole process works just fine if after changing the 'code' field, I then
pull down the select set (with only one element) for name and select it,
because the onChange action of 'name' triggers the queries for the dependent
fields.
But the requirement I'm trying to satisfy says that the name field should
automatically assume the value in its single element select set without me
having to pulldown and select.
I wonder if there isn't some VBA "magic" that I can put in the onChange
event subroutine Code_AfterUpdate() that forces the 'name' combo box to
assume the value of the only item in its select set.
You help would be GREATLY appreciated.
- Frank Rudolph