Set combobox to blank

slimjen1

Registered User.
Local time
Today, 11:52
Joined
Jun 13, 2006
Messages
562
All; I have a question. I have a form based on a table with just sales quotes and dates. I am using the salesquote as a combo box to select cooresponding records in a subform.

Code:
Private Sub cboSalesquote_AfterUpdate()
   Me.Filter = "[salesquote]=" & cboSalesquote
   Me.FilterOn = True
End Sub

Works fine. But not the mgr says his users get confused when they are making changes in the subform which record they are changing so they want when they select a record from the combo box and the records appear in the subform; they want the combo box to go blank. I am not sure how to do this because if I reset the combo box to go blank; the subform records will go blank as well. Is there a way to do this?
 
Me.FilterOn = false
cbosalesquote = null
 
This doesn't work. I used this before. the master and child links are cbosalesquote for the combo box and salesquote for the subform. Maybe I need another way to link the data
 
I use this ALL the time. It works perfectly.
 
I must be doing something wrong. This is my code modified with your suggestions:

Code:
Private Sub cboSalesquote_AfterUpdate()
   Me.Filter = "[Salesquote]=" & cboSalesquote
   Me.FilterOn = False
   Me.cboSalesquote = Null
End Sub
 
The code that Ranman256 does exactly what you're after.
Code:
Private Sub cboSalesquote_AfterUpdate()
    With Me
        .Filter = "[Salesquote] = " & .cboSalesquote
        .FilterOn = [COLOR=Blue]True[/COLOR]
        .cboSalesquote = Null
    End With
End Sub
... I don't know why you decided to turn off the filter.

... if I reset the combo box to go blank; the subform records will go blank as well. Is there a way to do this?
No, because, setting the value of the combo box in code will not fire its After Update event.
 

Users who are viewing this thread

Back
Top Bottom