Computing.Net > Forums > Programming > MS-Access VBA Combo box

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

MS-Access VBA Combo box

Reply to Message Icon

Name: glen MC
Date: February 19, 2003 at 04:59:39 Pacific
OS: nt 4.0
CPU/Ram: 1ghz 256
Comment:

G'day , i am trying to workout how to change the contence of a combo box in referance to what was in the previous box

IE if someone selects dell from 1 combo box the next box will have the model of dell systems and if they select compaq they only get the compaq models in the next combo box

any help would be apreicated

Cheers
Glen




Sponsored Link
Ads by Google

Response Number 1
Name: Ryan
Date: February 19, 2003 at 07:17:46 Pacific
Reply:

Hello,

I did something along those lines a while ago but lost my code. First you need to make an access database with the two fields (manufacturer and ID, for the one table, and model and ID for the other table). Then open the database for the manufacturer do something like:

cboManufacturer.List(cmbManufacturer.ListIndex)= CurrentManufacturer

If currentMaunfacturer rs!Manufacturer Then
rs.MoveNext
End If

CurrentID = rs!ID

Then open the Model table

Do While rs.EOF = False
If currentIDrs!ID AND rs.EOF = False then
rs.MoveNext
End If

rs!Model = cboModel.List(cmbModel.ListIndex + (cmbModel.ListCount))

Loop

I think that's how I did it. Try it out and let me know what happened.



0

Response Number 2
Name: mark
Date: February 19, 2003 at 09:29:50 Pacific
Reply:


something like

after update of combo one

if combo1.value = "dell" then combo2.rowsource = "dell specs"
refresh

that means if dell is selected in combo 1 then combo 2 source should change to x and refresh just refreshs the data to display correct stuff in combo 2


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: MS-Access VBA Combo box

VBA combo boxes www.computing.net/answers/programming/vba-combo-boxes/8950.html

MS Access VBA www.computing.net/answers/programming/ms-access-vba/1632.html

Combo Box Programming on Access using VB www.computing.net/answers/programming/combo-box-programming-on-access-using-vb/2416.html