i've been trying to do this for ages and i can't do it.
how do you limit the data in a combo box control depending on the
fields that have already been entered in other controls?
[Forms]![Frm - form Cable supply cost
estimator].[Form]![Description].RowSourceType = "table/query"
[Forms]![Frm - form Cable supply cost estimator].[Form]
[Description].RowSource = "SELECT DISTINCTROW [Tbl - Cable].Size in
sqmm, [Tbl - Cable].Rated voltage kV, [Tble - Cable].Description FROM
[Tbl - Cable] " _
& "GROUP BY [Tbl - Cable].Size in sqmm, [Tbl - Cable].Rated
voltage kV, [Tbl - Cable].Description " _
& "HAVING ([Tbl - Cable].Size in sqmm=[Forms]![Frm - form Cable
supply cost estimator].[Form]![Size in sqmm] AND [Tbl - Cable].Rated
voltage kV =[Forms]![Frm - form Cable supply cost
estimator].[Form]![Rated voltage kV]) " _
& "ORDER BY [Tbl - Cable].Description"
here's the code i've tried and it doesn't work!!!!!!!!!!
is there an easier way to do it?
ahhhhhhhhhhhh please help smart dudes out there!!!!!!!!
Sparky - 30 Jan 2004 22:52 GMT
Set it's RowSource property to a valid SQL "SELECT" statement, based on what
was selected in the other control.
'------------------------------------
private sub cboCustomers_AfterUpdate()
cboBranches.rowsource = "SELECT * FROM tblBranches WHERE Cust_ID = "
& cboCustomers
end sub
'------------------------------------
Obviously this relies on the "bound column" of cboCustomers being correct,
but I'll leave that up to you to sort out ;-)
Sparky.
> i've been trying to do this for ages and i can't do it.
>
[quoted text clipped - 19 lines]
>
> ahhhhhhhhhhhh please help smart dudes out there!!!!!!!!
Joe - 30 Jan 2004 23:03 GMT
> i've been trying to do this for ages and i can't do it.
>
> how do you limit the data in a combo box control depending on the
> fields that have already been entered in other controls?
It's been a while since I've done much Access work. (Does Access 2003
stomp previous versions of the Access run-times? This sort of thing
has been a big enough problem with Access to limit its usefulness...)
The last time I did this, I used the combos' Enter and Exit events to
limit the items only when a combo actually has the focus.
--
Joe Foster <mailto:jlfoster%40znet.com> "Regged" again? <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above They're coming to
because my cats have apparently learned to type. take me away, ha ha!