Clearing a combo box based on another combox

RyLane

Registered User.
Local time
Today, 12:20
Joined
Feb 4, 2014
Messages
60
Hi,

I have a combo box (cbodate) and it's based on another combo box (cboagent). Right now when I select and agent, the date box shows the dates specific to that person and when I select one, I open a form with the info. The issue is when I want to select a new agent, the date box shows the old date until I select a new one. Is there a way to have the date combo go to a blank when a new agent is selected?

I have this right now in the afterupdate for the first box (cboagent)
Me.cboDate = Null
Me.cboDate.Requery
Me.cboDate = Me.cboDate.ItemData(0)

Thanks.
 
Me.cboDate.value = Null
Me.cboDate.Requery
Me.cboDate = Me.cboDate.ItemData(0)
 
Didn't change anything by adding .Value
 
What if you comment out the last line? All that code is doing is defaulting to row zero of that record source.
 
I copied that code from somewhere else, all I know is that when when I go to select another agent from the first combo box, the second one will get updated once that selection is made. Without the code, the second combo box stays on whatever was my first selection and will not update when I change the first one.
 
I'm not following. Do you want the second box to update? If I am understanding correctly, you want to update the second combo ONLY the first time you select an agent and want the 2nd combo to be "null" when you again select an agent?
 
That is correct.

Update the second box to null/blank everytime a selection is made in the first box.
 

Users who are viewing this thread

Back
Top Bottom