Linking Controls from Different Recordsource within a Form

  • Thread starter edisonl via AccessMonster.com
  • Start date
E

edisonl via AccessMonster.com

Hi All,

Might be slightly confusing.. I had a Form (F_Form), Recordsource (F_table),
Multiple control (Control 1..... n ), But 1 particular control (Called it
Control CH_ComboBox) recordsource I like to set it to

G_Table.
Therefore if G_Table Updates this field, CH_ComboBox should be reflected
accordingly & automatically.

However I allow 1 time entry only, which means previously

if (IsNull(Ch_ComboBox))then
CH_ComboBox.recordsource.enabled = True
CH_ComboBox.recordsource = H_Table

Else
CH_ComboBox.recordsource.enabled = False
CH_ComboBox.recordsource = F_Table
End If

Regards, Edison
 
R

Rod Plastow

Edisonl,

I'm not admitting to understanding your question or your requirements but
one look at your code examples show a number of errors.

A combo box does not have a RecordSource property; it does however have a
RowSource property.

RowSource does not have an Enabled property.

You need to enclose the table name with double quotes.

It may be judicious to ensure that the RowSourceType is set to "Table/Query"

I can't remeber whether changing the RowSource forces a requery or not. I
think it does but be prepared to issue a requery if it does not.

CH_ComboBox.RowSourceType = "Table/Query"
CH_ComboBox.RowSource = "H_Table"

If you need the requery then it's simply

CH_ComboBox.Requery

Rod
 
Top