M
M. Arshad
New to Access - need help!
I have two Combo Boxes, Sector and Site on a Form for inputting data.
Sector is unbound while Site is bound.
I use the Sector to select a sector.
Next, I filter the list for Site based on the value selected in the Sector.
After selecting the Sector as well as Site, the user may realize that s/he
made a mistake and want to change the Sector. If so, the filtered list for
Site will change. I requery the Site after changing the Sector using
AfterUpdate event for the Sector. This gives me the updated filtered list in
Site (as desired).
However, the previous value in Site "hangs around" till I select a new value
from the Combo.
What I would like to do is clear the previous value in Site as soon as
update the value in Sector so that the user sees an "empty" field rather than
seeing the previous value.
I have tried the following code in the AfterUpdate_Sector, without success.
1. Me.Site.Undo ; nothing happens
2. Me.Site = Null ; this gives me the following error.
run-time error '3162'
You tried to assign the Null value to a
variable that is not a variant data type.
Will greatly appreciate any help pointer to get the desired behavior.
M. Arshad
I have two Combo Boxes, Sector and Site on a Form for inputting data.
Sector is unbound while Site is bound.
I use the Sector to select a sector.
Next, I filter the list for Site based on the value selected in the Sector.
After selecting the Sector as well as Site, the user may realize that s/he
made a mistake and want to change the Sector. If so, the filtered list for
Site will change. I requery the Site after changing the Sector using
AfterUpdate event for the Sector. This gives me the updated filtered list in
Site (as desired).
However, the previous value in Site "hangs around" till I select a new value
from the Combo.
What I would like to do is clear the previous value in Site as soon as
update the value in Sector so that the user sees an "empty" field rather than
seeing the previous value.
I have tried the following code in the AfterUpdate_Sector, without success.
1. Me.Site.Undo ; nothing happens
2. Me.Site = Null ; this gives me the following error.
run-time error '3162'
You tried to assign the Null value to a
variable that is not a variant data type.
Will greatly appreciate any help pointer to get the desired behavior.
M. Arshad