Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform field to show values based on main form and a table 1

Status
Not open for further replies.

csk003

Programmer
Feb 9, 2004
26
0
0
US
The main form(datasource: table1) and sub form are linked through an id.
The values in subform(datasource:table2) for the column- subcolumn2 should be based on main form column2(value selected by user) and a table5.
(Table5 has valid values of column2 and subcolumn2.

I should be able to see the previous values entered for subcolumn2 and also have the ability to enter new values. But the subcolumn2 should show legal values in drop down based on column2(main form) and table5.

I made the row source property of subcolumn2(combo box) to point to a query(select subcolumn2 from table5 where table5.column2 = forms!mainform!column2)
I get the correct values for subcolumn2 for the first record in main form but the drop down list doesn't change though I change column2 in mainform or advance to a different record unless I reopen the form


 
I think you must requery your combox.
For instance in the afterupdate() put like:
Me.Combo.Requery


Pampers [afro]
There is only one way to change a diaper - fast
 
Thanks, Put the requery code in the change sections and it worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top