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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help with multiple combo box filters.

Status
Not open for further replies.

KeeFJ

Technical User
Apr 2, 2009
3
GB
I'm new to access and vba but been tasked with creating an asset register database at work..i have created a db with a single table with a form and subform the subform is laid out as a datasheet and the main form has a series of boxes detailing the full details of each asset..

i have created 15 combo boxes that each act as a individual filter on the datasheet, but i need to get them to work along side any number of the other 14 combo boxes to filter the assets further.. (i know 15 filters is a lot but trust me its needed...)

the code i have used for the combo boxes is as below but "cbostore" changing to identify each box..

Please can someone let me know where im going wrong..

Regards and many thanks for you time and help..

KeeF

Code:
Private Sub cboStore_AfterUpdate()

Dim strSQL As String           

strSQL = " SELECT * FROM AssetLog "    
strSQL = strSQL & " WHERE AssetLog.BranchNUMBER = '" & cboStore & "';"                   

Me!AssetSF.LinkChildFields = "BRANCHNUMBER"    
Me!AssetSF.LinkMasterFields = "BRANCHNUMBER"    Me.RecordSource = strSQL    
Me.Requery

End Sub
 
thread701-1539901 might be of use to you (have a look and dhhokum and PHV's answer's rather than mine, I had an off day yesterday [wink]).

Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top