Conditionally Change a ComboBox RowSource from one Query to another. (1 Viewer)

Status
Not open for further replies.

Pat Wood

New member
Local time
Today, 08:30
Joined
Nov 20, 2006
Messages
3
Here is a simple sub I wrote to use when I need to use different Queries for the same ComboBox:
Code:
Private Sub MycboBox_GotFocus()

    If Me!myCheckBox = True Then
        Me!MycboBox.RowSource = "Query1"
    Else 
        Me!MycboBox.RowSource = "Query2"
    End If
End Sub
I have a table for "Members" and one for "Prospects". My CheckBox indicates if a person is a "Member". This code allows me to easily enter the names of "Members" or "Prospects" as needed in my ComboBox.
 
Last edited by a moderator:
Status
Not open for further replies.

Users who are viewing this thread

Top Bottom