Combo Box limited values (1 Viewer)

stu_c

Registered User.
Local time
Today, 19:39
Joined
Sep 20, 2007
Messages
489
Hi all
I have a form with drop down lists of Makes or vehicles and models, ideally I want to say when the user clicks on the manufacturer it only shows the models from that particular brand how do you do this?

Table field names
MANUFACTURER
MODEL

FORM OCOMB BOX NAMES
CMBMANUFACTURER
CMBMODEL

Do i have to have separate tables for Manufacturer and model or fine in one?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:39
Joined
May 7, 2009
Messages
19,169
cascading combobox will not work on continuous form, unless you add an extra textbox to it.

create a query (qryModel):

select model from YourTable Where Manufacturer = [Forms]![YourFormName]![cmbManufacturer];

set qryModel as the Rowsource of cmbModel.

add code to cmbManufacturer AfterUpdate event to Requery cmbModel combobox:

private sub cmbManufacturer_AfterUpdate()
Me!cmbModel.Requery
End Sub
 

stu_c

Registered User.
Local time
Today, 19:39
Joined
Sep 20, 2007
Messages
489
cascading combobox will not work on continuous form, unless you add an extra textbox to it.

create a query (qryModel):

select model from YourTable Where Manufacturer = [Forms]![YourFormName]![cmbManufacturer];

set qryModel as the Rowsource of cmbModel.

add code to cmbManufacturer AfterUpdate event to Requery cmbModel combobox:

private sub cmbManufacturer_AfterUpdate()
Me!cmbModel.Requery
End Sub

THANK YOU!, just for my knowledge how owuld that be if it was in a sub form?
[Forms]![YourmianFormName]![Subformname]![cmbManufacturer];
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:39
Joined
May 7, 2009
Messages
19,169
[Forms]![YourmianFormName]![Subformname].[Form]![cmbManufacturer];
 

Users who are viewing this thread

Top Bottom