L
LJG
Hi Guys,
I am trying to get this code to work and wonder if someone can give me a
hand.
I have a form with a combo control and need to select different row source
if the value of a field meets selected criteria. My Code is:
Private Sub qty_AfterUpdate()
If Me.qty <= 4 Then
Me.cbosoft.RowSource = "SELECT [Software Costs].softID, [Software
Costs].Description, [Software Costs]. 1_off "
FROM [Software Costs] WHERE [Software Costs].type = "epos"
If Me.qty >= 5 and <=9 Then
Me.cbosoft.RowSource = "SELECT [Software Costs].softID, [Software
Costs].Description, [Software Costs]. advantage"
FROM [Software Costs]
WHERE [Software Costs].type = "epos"
If Me.qty >= 10 and <=14 Then
Me.cbosoft.RowSource = "SELECT [Software Costs].softID, [Software
Costs].Description, [Software Costs]. premier"
FROM [Software Costs]
WHERE [Software Costs].type = "epos"
If Me.qty >= 15 and <=19 Then
Me.cbosoft.RowSource = "SELECT [Software Costs].softID, [Software
Costs].Description, [Software Costs]. corporate"
FROM [Software Costs]
WHERE [Software Costs].type = "epos"
End If
End If
End If
End If
End Sub
The problem I get initially is that the system fails on the FROM section,
also need help in the correct format of the IF part of the statement.
All suggestions appreciated.
TIA
Les
I am trying to get this code to work and wonder if someone can give me a
hand.
I have a form with a combo control and need to select different row source
if the value of a field meets selected criteria. My Code is:
Private Sub qty_AfterUpdate()
If Me.qty <= 4 Then
Me.cbosoft.RowSource = "SELECT [Software Costs].softID, [Software
Costs].Description, [Software Costs]. 1_off "
FROM [Software Costs] WHERE [Software Costs].type = "epos"
If Me.qty >= 5 and <=9 Then
Me.cbosoft.RowSource = "SELECT [Software Costs].softID, [Software
Costs].Description, [Software Costs]. advantage"
FROM [Software Costs]
WHERE [Software Costs].type = "epos"
If Me.qty >= 10 and <=14 Then
Me.cbosoft.RowSource = "SELECT [Software Costs].softID, [Software
Costs].Description, [Software Costs]. premier"
FROM [Software Costs]
WHERE [Software Costs].type = "epos"
If Me.qty >= 15 and <=19 Then
Me.cbosoft.RowSource = "SELECT [Software Costs].softID, [Software
Costs].Description, [Software Costs]. corporate"
FROM [Software Costs]
WHERE [Software Costs].type = "epos"
End If
End If
End If
End If
End Sub
The problem I get initially is that the system fails on the FROM section,
also need help in the correct format of the IF part of the statement.
All suggestions appreciated.
TIA
Les