Link to home
Start Free TrialLog in
Avatar of malharbarai
malharbarai

asked on

Change value in 2nd combo

hi all

i have to 2 combo's in my form both populated from database, but when a particular value is selected from combo1, values in combo2 should change corresponding to the value in combo1...

how do i achieve this...is it possible...??
at the moment its giving me 'Run-time error 3709' - 'Operation is not allowed on an object refrencing a closed or invalid connection'...

tia
MB
ASKER CERTIFIED SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sazhagianambi
sazhagianambi

Hi,

Normally.

'Run-time error 3709' - 'Operation is not allowed on an object refrencing a closed or invalid connection'...

This Error Occur When You Are Trying To Open a recodset Thru Inavlid Connection object. So Please Check Your Connection Object Status. Most Propably You closed the Connection Object Before Trying to Excute Sql statement. Plz Check it.

Nambi
Hi malharbarai,
This old question (QID 20557021) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
Avatar of malharbarai

ASKER

this is what i figured out as the solutions

connString = "select area.serno,area.area,city.serno from area,city where city.city='" & cityVal & "' and area.city_code=city.serno order by area.area"
changeAreaRs.Open connString, ADOConn, adOpenDynamic, adLockReadOnly

While Not changeAreaRs.EOF
    areaCombo.AddItem changeAreaRs("area").Value
    areaCombo.ItemData(areaCombo.NewIndex) = changeAreaRs("area.serno").Value
    changeAreaRs.MoveNext
Wend

changeAreaRs.Close

the solution is much like wat DHAEST suggested, so I would surely like to award him those points

thnx
Thanks.
I'm glad that the problem is solved now
Much close to my requirement.

Thnx indeed