Discussion Locked

dynamic combobox

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I use Micorsoft Access 2000. I have a form which contains among others one field(refctrl) and a combobox (refsubj). Depending on whether the field refctrl is blank or filled in the items to be displayed in the combo box refsubj should be dynamicallyregulated. How can this be done? What is the VBA code that will help?

3 replies

by andrew

Here's one way:

Add code to the Text box Change event handler:

Private Sub Text1_Change()
If Text1.Text <> "" Then
Me.Combo1.RowSource = "SELECT Table1.key FROM Table1;"
End If
End Sub

Test the field and set the combo's RowSource property if not blank.

This discussion is closed to new replies.