R
Roger Collette
Hello;
I have a combobox that looks at a table which sets the criteria of a field .
Based on the criteria ; the list box in the same form gets populated in the
form.
Combo28 (Coulmn (1) is where hte criteria is
List name is : lstInstrIssue (Shows results)
Table for criteria is criteria2:
criteria2 Product ID Product Name Product Description
1 Like 'HV*' All Automated Valves
2 Like 'MU*' All Motors
3 Like 'AI*' All Analog Inputs
4 Like 'AO*' All Analog Outputs
9 Like 'SI*' All Switches
10 Like 'T*' ProfiBus Transmitter
11 Like 'MS*'
12 Like "??T*"
13 Like "HV*" Test all automated Valves
14 Like "MU*" OR Like "MS*" Test All Motors
when I enter Like "MU*" it works, Like "MS*" also works on different lines
in the combo box. However if I use
Like "MU*" OR Like "MS*" on the same line it stops working. I also tried
Like 'MU*' . What am I doing wrong.
The back end tables are on SQL server.
Here is the Code;
Private Sub Combo28_AfterUpdate()
Dim strSelected As String
'strSelected = "select * from MYTABLE_COMPONENT where [CMPNT_NAME]" &
Me![Combo28].Column(1)
strSelected = "SELECT [Query2].CMPNT_ID,[Query2].CMPNT_NAME,
[Query2].CMPNT_NUM,[Query2].SPEC_CMPNT_TYPE,[Query2].SPEC_CMPNT_FUNC FROM
[Query2] where [CMPNT_NAME]" & Me![Combo28].Column(1)
Me!lstInstrIssue.RowSource = strSelected
Me.Combo6 = ""
Me!cmdSelectIssue.Enabled = True
Me!cmdclearall.Enabled = True
lstInstrIssue.Requery
End Sub
I have a combobox that looks at a table which sets the criteria of a field .
Based on the criteria ; the list box in the same form gets populated in the
form.
Combo28 (Coulmn (1) is where hte criteria is
List name is : lstInstrIssue (Shows results)
Table for criteria is criteria2:
criteria2 Product ID Product Name Product Description
1 Like 'HV*' All Automated Valves
2 Like 'MU*' All Motors
3 Like 'AI*' All Analog Inputs
4 Like 'AO*' All Analog Outputs
9 Like 'SI*' All Switches
10 Like 'T*' ProfiBus Transmitter
11 Like 'MS*'
12 Like "??T*"
13 Like "HV*" Test all automated Valves
14 Like "MU*" OR Like "MS*" Test All Motors
when I enter Like "MU*" it works, Like "MS*" also works on different lines
in the combo box. However if I use
Like "MU*" OR Like "MS*" on the same line it stops working. I also tried
Like 'MU*' . What am I doing wrong.
The back end tables are on SQL server.
Here is the Code;
Private Sub Combo28_AfterUpdate()
Dim strSelected As String
'strSelected = "select * from MYTABLE_COMPONENT where [CMPNT_NAME]" &
Me![Combo28].Column(1)
strSelected = "SELECT [Query2].CMPNT_ID,[Query2].CMPNT_NAME,
[Query2].CMPNT_NUM,[Query2].SPEC_CMPNT_TYPE,[Query2].SPEC_CMPNT_FUNC FROM
[Query2] where [CMPNT_NAME]" & Me![Combo28].Column(1)
Me!lstInstrIssue.RowSource = strSelected
Me.Combo6 = ""
Me!cmdSelectIssue.Enabled = True
Me!cmdclearall.Enabled = True
lstInstrIssue.Requery
End Sub