G
Guest
I have a form that I've developed that shows data from all over my database,
grouping it all together and displaying it for the user's ease of use. There
are four status indicator columns on this form, each one either equal to
"Green", "Yellow", or "Red". At the bottom of each column is a drop-down
combo box I have added that allows the user to filter on a certain color, so
they can see what records have a certain status. They can search on "Green",
"Yellow", "Red", or "All", which removes all filtering.
Three of the four comboboxes work perfectly, but the fourth throws the
following error no matter what I click:
Run-Time Error '2001': You cancelled the previous operation.
The code for the combobox is almost identical to the others, the only
difference being the names of the comboboxes and the filtered fields:
cboForecastScheduleCol = "All"
cboForecastCostCol = "All"
cboOverallStatCol = "All"
If cboCostToDateCol.Column(0) = "Green" Then
Me.Filter = "IND_CTD = 'Green'"
Me.FilterOn = True
Me.Requery
Me.txtFiltered.Visible = True
ElseIf (cboCostToDateCol.Column(0)) = "Yellow" Then
Me.Filter = "IND_CTD = 'Yellow'"
Me.FilterOn = True
Me.Requery
Me.txtFiltered.Visible = True
ElseIf (cboCostToDateCol.Column(0)) = "Red" Then
Me.Filter = "IND_CTD = 'Red'"
Me.FilterOn = True
Me.Requery
Me.txtFiltered.Visible = True
ElseIf (cboCostToDateCol.Column(0)) = "All" Then
Me.Filter = ""
Me.FilterOn = False
Me.Requery
Me.txtFiltered.Visible = False
End If
I have tried setting me.dirty = False, I've tried using docmd.save to save
the record, nothing. The code is the exact same as works perfectly on three
other controls of the same time on the same form. What could possibly be
wrong?
Thanks,
Dustin
grouping it all together and displaying it for the user's ease of use. There
are four status indicator columns on this form, each one either equal to
"Green", "Yellow", or "Red". At the bottom of each column is a drop-down
combo box I have added that allows the user to filter on a certain color, so
they can see what records have a certain status. They can search on "Green",
"Yellow", "Red", or "All", which removes all filtering.
Three of the four comboboxes work perfectly, but the fourth throws the
following error no matter what I click:
Run-Time Error '2001': You cancelled the previous operation.
The code for the combobox is almost identical to the others, the only
difference being the names of the comboboxes and the filtered fields:
cboForecastScheduleCol = "All"
cboForecastCostCol = "All"
cboOverallStatCol = "All"
If cboCostToDateCol.Column(0) = "Green" Then
Me.Filter = "IND_CTD = 'Green'"
Me.FilterOn = True
Me.Requery
Me.txtFiltered.Visible = True
ElseIf (cboCostToDateCol.Column(0)) = "Yellow" Then
Me.Filter = "IND_CTD = 'Yellow'"
Me.FilterOn = True
Me.Requery
Me.txtFiltered.Visible = True
ElseIf (cboCostToDateCol.Column(0)) = "Red" Then
Me.Filter = "IND_CTD = 'Red'"
Me.FilterOn = True
Me.Requery
Me.txtFiltered.Visible = True
ElseIf (cboCostToDateCol.Column(0)) = "All" Then
Me.Filter = ""
Me.FilterOn = False
Me.Requery
Me.txtFiltered.Visible = False
End If
I have tried setting me.dirty = False, I've tried using docmd.save to save
the record, nothing. The code is the exact same as works perfectly on three
other controls of the same time on the same form. What could possibly be
wrong?
Thanks,
Dustin