thank you brother for your assistance.
________________________________ From: Liveson Tumbulu <[email protected]> To: [email protected] Sent: Wednesday, April 14, 2010 18:16:44 Subject: RE: [ms_access] 2 combo boxes and 1 subform Hasan To achieve your goal you need to requery the row source of the 2nd combo box every time the 1st combo box is updated. In the AfterUpdate event of the 1st combo box write code similar to this: Private Sub cboCategory_ AfterUpdate( ) Dim stCriteria AS String, stSQL AS String If Not Isnull(Me.cboCatego ry) Then stCriteria = "WHERE Category_ID = " & Me.cboCategory stSQL = "SELECT Product_ID, Product_Desc, Category_ID FROM Products " & stCriteria Me.cboProducts. RowSource = stSQL Me.cboProducts. Requery End If End Sub Please Note: In the above example I assume that . the Category_ID field has a number field type otherwise stCriteria should be "WHERE Category_ID = '" & Me.cboCategory & "'". Note the single quotes! . Category_ID is a foreign key in the table, Products, and a primary key in the Categories table. . Combo box 1 has a name cboCategory and combo box 2 cboProducts HTH Liveson From: ms_acc...@yahoogrou ps.com [mailto:ms_acc...@yahoogrou ps.com] On Behalf Of Hasan Raza Sent: Wednesday, 14 April, 2010 11:29 To: ms_acc...@yahoogrou ps.com Subject: [ms_access] 2 combo boxes and 1 subform dear group members, i have a problem. i have two combo boxes and one subform in which one is populated/linked with product-categories, 2nd combo box row source is products. and i want that when i select a category from 1st combo box then related products will shown in 2nd combo box and when i select a product from 2nd combo box then the related orders list will open in subform. kindly help me. advance thank you. Send instant messages to your online friends http://uk.messenger .yahoo.com [Non-text portions of this message have been removed] [Non-text portions of this message have been removed] Send instant messages to your online friends http://uk.messenger.yahoo.com [Non-text portions of this message have been removed]
