Linking

I

Ivor Williams

I have a form frmProjects. This form gets its data from table tblProjects
which has a primary key ProjNo. On the form is an unbound combobox called
cboProject which is used to select a project on the form.
On the form there is a tab control with a number of tabs, each of which has
on it a subform linked to frmProjects using ProjNo. On one of the tabs is a
subform sfrWarranty.
On sfrWarranty is a combobox cboUnit which is used to choose a unit. In the
row source for cboUnit, I went into the SQL statement and in Criteria under
ProjNo, entered "Forms!sfrWarranty.cboProjNo" (without the quotes) to limit
the units to choose from to those which pertain to the current project.
All works well until I choose a different project using cboProject on the
main form frmProjects. When I do this, the only way I can get the list in
cboUnit on the subform is to go to Records>Refresh. So far, I've not been
able to determine the Event to apply to which control to make this happen
automatically.

Ivor
 
J

John Vinson

I went into the SQL statement and in Criteria under
ProjNo, entered "Forms!sfrWarranty.cboProjNo" (without the quotes) to limit
the units to choose from to those which pertain to the current project.
All works well until I choose a different project using cboProject on the
main form frmProjects. When I do this, the only way I can get the list in
cboUnit on the subform is to go to Records>Refresh. So far, I've not been
able to determine the Event to apply to which control to make this happen
automatically.

Requery the combo box in the AfterUpdate event of cboProjNo:

Private Sub cboProjNo_AfterUpdate()
Me.cboUnit.Requery
End Sub

John W. Vinson[MVP]
 

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

Similar Threads

Go To Control 1
Incomprehensible OpenArgs behavior 2
check for duplicates 7
DCount Error 2001 1
requery repaint or what? 1
Assign Detail Number 5
Return multiple values 3
John Vinson 2

Top