Public Function StrNames()
Dim ctrl As Access.Control
For Each ctrl In Me.Controls
If ctrl.Tag = "?" Then
If Not IsNull(ctrl) Then
If StrNames = "" Then
StrNames = "'" & ctrl & "'"
Else
StrNames = StrNames & ", '" & ctrl & "'"
End If
End If
End If
Next ctrl
If StrNames <> "" Then
StrNames = "(" & StrNames & ")"
Else
StrNames = "('Something not in your list')"
End If
End Function
Private Sub cmboName_Enter()
Dim strSql As String
strSql = "Select Full_Name from tblData where Full_name not in " & StrNames & " ORDER BY Full_name"
Debug.Print strSql
cmboName.RowSource = strSql
End Sub
Private Sub cmboName2_Enter()
Dim strSql As String
strSql = "Select Full_Name from tblData where Full_name not in " & StrNames & " ORDER BY Full_name"
'Debug.Print strSql
cmboName2.RowSource = strSql
End Sub
Private Sub cmboName3_Enter()
Dim strSql As String
strSql = "Select Full_Name from tblData where Full_name not in " & StrNames & " ORDER BY Full_name"
'Debug.Print strSql
cmboName3.RowSource = strSql
End Sub
Private Sub cmboName4_Enter()
Dim strSql As String
strSql = "Select Full_Name from tblData where Full_name not in " & StrNames & " ORDER BY Full_name"
'Debug.Print strSql
cmboName4.RowSource = strSql
End Sub