Tim Marshall wrote:
[color=blue]
> This is a great article, but I prefer to use the on got focus event for
> the combo rather than the afer update event of the combo just selected.[/color]
To follow up - some may say this requeries the combo box even if you've
made no new choices when you go back to it. So I do this (air code):
Private Sub cboBldg_GotFocus()
Dim strSql As String
Dim strCurRowSource As String 'current row source
Dim booC As Boolean 'is it necessary to create/recreate the row
source?
Dim strMsg As String
SysCmd acSysCmdSetStatus, "Wait, retreiving building list"
strCurRowSource = Me.cboBldg.RowSource 'Current rowsource SQL
<snip construction of strSql for new row source which depends on
value of other combo boxes and possibly other controls (option groups
for sort order, etc>
'check to see if current row source SQL is the same - if different,
revise rowsource
'if no row source (strcurrowsource = "") create new SQL
booC = False
If strCurRowSource = "" Then
booC = True
Elseif strCurRowSource <> strSql Then
booC = True
End If
If booC = True Then Me.cboBldg.RowSource = strCurRowSource
Exit_Proc:
SysCmd acSysCmdClearStatus
Exit Sub
End Sub
--
Tim
http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me