record source

G

Guest

When tring to program what the Record Source and Record Source Type I get a blank combobox within the form.

The record Source I want in combo2 when the combo1 = "Accessories" is as follows

The record Source type is Table/Query
The Record Source is table A1

When the combobox1 = "Engines" I want combo2 as follows
record Soucre Type to = "Table/Query"
and Record Source = A2

My code is as follows:

If Combo1.value = "Accessories" then
combo2.recordsourceType = "Table/Query"
combo2.recordsource = "A1"
elseif
combo1.value = "Engines" then
combo2.recordsourceType = "Table/Query"
combo2.recordsource = "A2"

end If

Is there another wasy to go about it?

Wes
 
K

Ken Snell

A combo box does not have a RecordSource property; it has a RowSource
property. You need to change your code so that it uses the right property,
and then you need to requery the combo box after you set the RowSource:

If Combo1.value = "Accessories" then
combo2.RowSourceType = "Table/Query"
combo2.RowSourceType = "A1"
elseif
combo1.value = "Engines" then
combo2.RowSourceType = "Table/Query"
combo2.RowSourceType = "A2"
end If
Combo2.Requery

--
Ken Snell
<MS ACCESS MVP>

Wes said:
When tring to program what the Record Source and Record Source Type I get
a blank combobox within the form.
 

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