Combo Box

  • Thread starter Thread starter administrator
  • Start date Start date
A

administrator

I have followed Microsoft Knowledge Base Article #289670
in order to Synchronize Two Combo Boxes on a Form.
However, my second combo box is empty. Here is the code
I'm using. BKDate refers to the second combo box. FName
refers to the first combo box. FullName is the
information for FNAME and Bankdate is the info for the
BKdate.

Private Sub FName_AfterUpdate()

Me.BKDate.RowSource = "SELECT Bankdate FROM" & _
" Bkdate WHERE FullName = " & Me.FName & _
" ORDER BY BankDate"
Me.BKDate = Me.BKDate.ItemData(0)

End Sub

BKDate refers to the second combo box. FName refers to
the first combo box. FullName is the information for
FNAME and Bankdate is the info for the BKdate.

I think my code is working fine. I think I might need to
put something else in my control on the second combo box
but I can't figure out what. I currently have the
controls for BKName set to:

RowSourceType: Table/Query
ColumnWidths: 2

The rest are defaults.
 
Hi

Try to refresh the form or Requery the combo box

i.e.

Private Sub FName_AfterUpdate()

Me.BKDate.RowSource = "SELECT Bankdate FROM" & _
" Bkdate WHERE FullName = " & Me.FName & _
" ORDER BY BankDate"
Me.BKDate = Me.BKDate.ItemData(0)

me.refresh
or
me.combobox.requery

End Sub
 
Back
Top