combobox problem

G

gudiya

I have to design an edit form which displays that data about the
products and allow the user to edit it.I want a combobox which should
display the material name for the product and should show a list of all
the materials as drop down list and waant user could change the
material from this drop down list.finally this should be saved in the
table.

I have a product table which stores the materialid as foreign key and
the material table which has material_id and material _desc.I want the
material_id should be stored in products table when the user chooses
another material from the drop down list of combobox.

Please give a step by step procedure.need urgently.I am new to ms access
 
G

Guest

Gudiya,

Combo box behavior is controlled by the following key properties, many of
which can be set automatically by enabling the Wizard in form design view, by
selecting View, Toolbox, and clicking on the icon with the wand and stars.

Key Combo Box Properties
------------------------------
ControlSource What field to store the selected value in
RowSource An SQL query statement for the records in the drop-down
BoundColumn Which column from the RowSource is stored in
ControlSource
ColumnWidths The space allocated in the dropdown for each column

For most applications, you'd like the user to choose by a meaningful
description rather than a meaningless numerical ID, but store the numerical
foreign key in the underlying field. To do this, you set the BoundColumn to
1, and the 1st column width to 0". The first non-zero-width column is what
will display in box after the user makes his selection.

For your tables, assuming the name of the field in the Product table is
MatlID, set the properties as follows:

ControlSource MatlID
RowSource SELECT Material.Material_ID, Material.Material_Desc FROM
Material ORDER BY Material.Material_Desc;
BoundColumn 1
ColumnWidths 0";x", where x is large enough to display the longest
description

If you place the combo box with the wizard, Access will set all of these
properties for you, if you choose the "Hide Key Field (recommended)" option,
and then double-click on the right side of the column border to resize the
column to the widest entry.

Hope that helps.

Sprinks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top