AfterUpdate event and Form Filtering

K

Kirk P.

I've got this code in my AfterUpdate event of my combo box

Private Sub cboGlob_Disp_Name_AfterUpdate()

Dim strSQL As String
If IsNull(Me.cboGlob_Disp_Name) Then
' If the combo is Null, use the whole table as the RecordSource.
Me.RecordSource = "qselEQU_SEC_B"
Else
strSQL = "SELECT * FROM qselEQU_SEC_B " & _
"INNER JOIN qselEQU_SEC_A ON qselEQU_SEC_B.GLOBAL_COMPANY_DISPLAY_NAME =
qselEQU_SEC_A.[Global Company Display Name] " & _
"WHERE [Global Company Display Name] = " & Me.cboGlob_Disp_Name & ";"
Me.RecordSource = strSQL
End If
End Sub

The AfterUpdate event doesn't seem to be firing. When I click on one of the
selections, nothing happens - no error message or anything. Help?
 
R

Rick Brandt

I've got this code in my AfterUpdate event of my combo box

Private Sub cboGlob_Disp_Name_AfterUpdate()

Dim strSQL As String
If IsNull(Me.cboGlob_Disp_Name) Then
' If the combo is Null, use the whole table as the RecordSource.
Me.RecordSource = "qselEQU_SEC_B"
Else
strSQL = "SELECT * FROM qselEQU_SEC_B " & _ "INNER JOIN
qselEQU_SEC_A ON qselEQU_SEC_B.GLOBAL_COMPANY_DISPLAY_NAME =
qselEQU_SEC_A.[Global Company Display Name] " & _
"WHERE [Global Company Display Name] = " & Me.cboGlob_Disp_Name &
";" Me.RecordSource = strSQL
End If
End Sub

The AfterUpdate event doesn't seem to be firing. When I click on one of
the selections, nothing happens - no error message or anything. Help?

Do you have "[Event Procedure]" entered in the After Update property box?
 
K

Kirk P.

Yes, I do have [Event Procedure] in the After Update box. I don't know if
this makes any difference, but the combo box I'm using to filter the data is
based on a select query, which is based on an Oracle pass-through query. Not
sure if that makes any difference....

Rick Brandt said:
I've got this code in my AfterUpdate event of my combo box

Private Sub cboGlob_Disp_Name_AfterUpdate()

Dim strSQL As String
If IsNull(Me.cboGlob_Disp_Name) Then
' If the combo is Null, use the whole table as the RecordSource.
Me.RecordSource = "qselEQU_SEC_B"
Else
strSQL = "SELECT * FROM qselEQU_SEC_B " & _ "INNER JOIN
qselEQU_SEC_A ON qselEQU_SEC_B.GLOBAL_COMPANY_DISPLAY_NAME =
qselEQU_SEC_A.[Global Company Display Name] " & _
"WHERE [Global Company Display Name] = " & Me.cboGlob_Disp_Name &
";" Me.RecordSource = strSQL
End If
End Sub

The AfterUpdate event doesn't seem to be firing. When I click on one of
the selections, nothing happens - no error message or anything. Help?

Do you have "[Event Procedure]" entered in the After Update property box?
 
K

Kirk P.

Yes, it does have "[Event Procedure]" entered in the After Update property box.

Rick Brandt said:
I've got this code in my AfterUpdate event of my combo box

Private Sub cboGlob_Disp_Name_AfterUpdate()

Dim strSQL As String
If IsNull(Me.cboGlob_Disp_Name) Then
' If the combo is Null, use the whole table as the RecordSource.
Me.RecordSource = "qselEQU_SEC_B"
Else
strSQL = "SELECT * FROM qselEQU_SEC_B " & _ "INNER JOIN
qselEQU_SEC_A ON qselEQU_SEC_B.GLOBAL_COMPANY_DISPLAY_NAME =
qselEQU_SEC_A.[Global Company Display Name] " & _
"WHERE [Global Company Display Name] = " & Me.cboGlob_Disp_Name &
";" Me.RecordSource = strSQL
End If
End Sub

The AfterUpdate event doesn't seem to be firing. When I click on one of
the selections, nothing happens - no error message or anything. Help?

Do you have "[Event Procedure]" entered in the After Update property box?
 
R

Rick Brandt

Yes, I do have [Event Procedure] in the After Update box. I don't know
if this makes any difference, but the combo box I'm using to filter the
data is based on a select query, which is based on an Oracle
pass-through query. Not sure if that makes any difference....

An easy test to see if the code is firing is to temporarily add a line to
display a MsgBox...

MsgBox "test"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top