Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / January 2004



Tip: Looking for answers? Try searching our database.

crikey can you help (vb in access)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael La - 30 Jan 2004 01:18 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?

[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!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.