I have set up a group option box with 3 buttons, one for ‘prod”, another for “comp” and one for “all”. When I select the prod button, only the products appear in the combo box, when comp selected, only components appear in the combo box, when all is selected all products and components are selected. The products and components are in a field called Product. My problem is – When all is selected all products and components are mixed but in alphabetic order, when prod is selected or comp is selected, the product or component is not in alphabetic order. The code for the group option is as follows –
Private Sub Frame273_AfterUpdate()
Dim SQLText, WClause
SQLText = "SELECT [Product],[Manufacturer]FROM T_Product WHERE ProdCom = "
Select Case Me![Frame273]
Case 1
WClause = Chr(34) & "Prod" & Chr(34)
Case 2
WClause = Chr(34) & "Comp" & Chr(34)
Case 3
SQLText = "SELECT [Product],[manufacturer] FROM T_Product"
WClause = ""
End Select
With Me![Combo2]
.RowSource = SQLText & WClause
.Requery
.BackColor = RGB(255, 255, 255)
End With
End Sub
How can I have the sorts in alphabetic order? Also I set the “prod” button as default (1) in the option group default value, but the “all” button (3) remains the default, why is this?
Your advise would be appreciated.
kevsim
Private Sub Frame273_AfterUpdate()
Dim SQLText, WClause
SQLText = "SELECT [Product],[Manufacturer]FROM T_Product WHERE ProdCom = "
Select Case Me![Frame273]
Case 1
WClause = Chr(34) & "Prod" & Chr(34)
Case 2
WClause = Chr(34) & "Comp" & Chr(34)
Case 3
SQLText = "SELECT [Product],[manufacturer] FROM T_Product"
WClause = ""
End Select
With Me![Combo2]
.RowSource = SQLText & WClause
.Requery
.BackColor = RGB(255, 255, 255)
End With
End Sub
How can I have the sorts in alphabetic order? Also I set the “prod” button as default (1) in the option group default value, but the “all” button (3) remains the default, why is this?
Your advise would be appreciated.
kevsim